Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add min and max duration filters #457

Merged
merged 5 commits into from
Nov 30, 2022
Merged

Conversation

Th0masL
Copy link
Contributor

@Th0masL Th0masL commented Nov 19, 2022

This PR allows to use min_duration and max_duration (in seconds) as filter to detect if we want to download the episode or not.

Example of log lines :

INFO[2022-11-19T22:50:49+02:00] skipping due to regexp mismatch               episode_id=NIMLW2Ruxyz filter=title
INFO[2022-11-19T22:50:49+02:00] skipping due to duration filter               episode_id=Q5a81_JNxyz filter=min_duration
DEBU[2022-11-19T22:50:49+02:00] adding f6Vkhov_xyz ("Some episode name") to queue
INFO[2022-11-19T22:50:49+02:00] download count: 1                            
INFO[2022-11-19T22:50:49+02:00] ! downloading episode https://youtube.com/watch?v=f6Vkhov_xyz  episode_id=f6Vkhov_xyz index=0

@mxpv
Copy link
Owner

mxpv commented Nov 23, 2022

Also needs rebase

@Th0masL
Copy link
Contributor Author

Th0masL commented Nov 23, 2022

I've removed the helper, as suggested :)

Here is the overview of the log file, in debug mode:

DEBU[2022-11-23T20:07:49+02:00] -> SomeYoutubeChannel (update '@every 4h0m0s')
INFO[2022-11-23T20:07:49+02:00] -> updating https://www.youtube.com/user/SomeYoutubeChannel  feed_id=SomeYoutubeChannel format=audio quality=low
DEBU[2022-11-23T20:07:49+02:00] building feed
DEBU[2022-11-23T20:07:49+02:00] Expected to make 1 API calls to get the descriptions for 4 episode(s).
DEBU[2022-11-23T20:07:49+02:00] received 4 episode(s) for "SomeYoutubeChannel"
DEBU[2022-11-23T20:07:49+02:00] successfully saved updates to storage
INFO[2022-11-23T20:07:49+02:00] downloading episodes                          page_size=4
INFO[2022-11-23T20:07:49+02:00] skipping due to regexp mismatch               episode_id=QSUyW2SYxyz filter=title
INFO[2022-11-23T20:07:49+02:00] skipping due to duration filter (1616s)       episode_id=Q5a81JNaxyz filter=min_duration
INFO[2022-11-23T20:19:51+02:00] skipping due to duration filter (4903s)       episode_id=mDJ65ortxyz filter=max_duration
DEBU[2022-11-23T20:07:49+02:00] adding f6Vkhov_xyz ("Some video name") to queue
INFO[2022-11-23T20:07:49+02:00] download count: 1
INFO[2022-11-23T20:07:49+02:00] ! downloading episode https://youtube.com/watch?v=f6Vkhov_xyz  episode_id=f6Vkhov_xyz index=0
DEBU[2022-11-23T20:08:50+02:00] copying file                                  episode_id=f6Vkhov_xyz index=0
INFO[2022-11-23T20:08:50+02:00] creating file: /tmp/podsync/data/SomeYoutubeChannel/f6Vkhov_xyz.mp3  name=SomeYoutubeChannel/f6Vkhov_xyz.mp3
DEBU[2022-11-23T20:08:50+02:00] written 71075789 bytes                        name=SomeYoutubeChannel/f6Vkhov_xyz.mp3
INFO[2022-11-23T20:08:50+02:00] successfully downloaded file "f6Vkhov_xyz"    episode_id=f6Vkhov_xyz index=0
INFO[2022-11-23T20:08:50+02:00] downloaded 1 episode(s)
INFO[2022-11-23T20:08:50+02:00] nothing to clean                              feed_id=SomeYoutubeChannel
DEBU[2022-11-23T20:08:50+02:00] building iTunes podcast feed
INFO[2022-11-23T20:08:50+02:00] creating file: /tmp/podsync/data/SomeYoutubeChannel.xml  name=SomeYoutubeChannel.xml
DEBU[2022-11-23T20:08:50+02:00] written 10517 bytes                           name=SomeYoutubeChannel.xml
DEBU[2022-11-23T20:08:50+02:00] building podcast OPML
INFO[2022-11-23T20:08:50+02:00] creating file: /tmp/podsync/data/podsync.opml  name=podsync.opml
DEBU[2022-11-23T20:08:50+02:00] written 130 bytes                             name=podsync.opml
INFO[2022-11-23T20:08:50+02:00] successfully updated feed in 1m0.980123362s
INFO[2022-11-23T20:08:50+02:00] next update of SomeYoutubeChannel: 2022-11-24 00:07:49 +0200 EET

Copy link
Owner

@mxpv mxpv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mxpv mxpv merged commit 8e761bc into mxpv:main Nov 30, 2022
@Th0masL Th0masL deleted the add_duration_filters branch November 30, 2022 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants