meeb / tubesync

Syncs YouTube channels and playlists to a locally hosted media server
GNU Affero General Public License v3.0
1.98k stars 129 forks source link

add command line arguments #42

Closed c0deweaver closed 3 years ago

c0deweaver commented 3 years ago

How do you add extra arguments to youtube-dl?

I am getting rate limited by google because the indexing is trying to pull all the videos

I want to add youtube-dl --dateafter now-{Download cap} to limit the number of items being queried.

per yt-dl docs: https://github.com/ytdl-org/youtube-dl#video-selection-1

meeb commented 3 years ago

Yeah this is a known and not entirely unsurprising issue given the amount of requests tubesync can generate to YouTube if you add some large channels. There is an issue open that once complete should resolve this long term in #38 - but in the short term you can manually edit the arguments if you prefer to not wait for the next release.

The arguments are pre-set but configurable via a config file at the moment. The defaults are set here:

https://github.com/meeb/tubesync/blob/main/tubesync/tubesync/settings.py#L144

These are the options for the embedded youtube-dl, so not exactly the same name and formats as the CLI args, you can see the options here:

https://github.com/ytdl-org/youtube-dl/blob/3e4cedf9e8cd3157df2457df7274d0c842421945/youtube_dl/YoutubeDL.py#L137-L312

To change the YOUTUBE_DEFAULTS you'll need to edit this into your local_settings.py, either by copying then overwriting the file using a volume if you're using the container or just editing the file if you've manually installed it. There isn't the provision to edit the defaults via env vars or anything easier right now in the current release.

meeb commented 3 years ago

Can you give the :latest image a go and see if this reduces or resolves your 429 (rate limiting) issues please?

meeb commented 3 years ago

You've not replied but other general feedback so far is that since v0.9 release the 429 rate limiting issues have been solved. The --dateafter style feature is already managed internally by TubeSync. I'll close this issue for now, please create a new one if you find you might want another command line style argument option.