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

youtube-dl cache to fasten download #1846

Closed
kudumi opened this issue Nov 28, 2013 · 2 comments
Closed

youtube-dl cache to fasten download #1846

kudumi opened this issue Nov 28, 2013 · 2 comments
Labels

Comments

@kudumi
Copy link

@kudumi kudumi commented Nov 28, 2013

I am using youtube-dl under macports (osx 10.9). I like to use filters like (--match-title REGEX or --date) to download a single video of specific youtube user.

for a specific date, I use

youtube-dl --date ymd ytuser:gronkh
filtered one

youtube-dl ytuser:Gronkh --match-title '(?=._Minecraft)(?=._1170)'
In all the cases it's indexing the whole playlist of the ytuser, no matter even if I want to download a single video.

[youtube:user] Gronkh: Downloading video ids from 1 to 51
[youtube:user] Gronkh: Downloading video ids from 51 to 101
[youtube:user] Gronkh: Downloading video ids from 101 to 151
[youtube:user] Gronkh: Downloading video ids from 151 to 201
[youtube:user] Gronkh: Downloading video ids from 201 to 251
[youtube:user] Gronkh: Downloading video ids from 251 to 301
[youtube:user] Gronkh: Downloading video ids from 301 to 351

I thought this happens just first for the fist time for a new youtube user but this happens all the time for the same user, which is taking hell of time to download a single video. I know that I can use URL for a single video but I want to automate with filter based script.

I also tried specifying cache directory which did nothing, I can see any cache files

youtube-dl --cache-dir ~/Downloads/test/ ytuser:gronkh
Is there any way to fast-up this process? thanks

@phihag
Copy link
Contributor

@phihag phihag commented Nov 29, 2013

The --cache-dir option is set by default to ~/.cache/youtube-dl, so setting it to something else will have just change the location of the cache. At the moment, the cache dir is used just for storing youtube players for obfuscated signatures. Since all of the videos in your playlist use plain signatures, the cache is completely irrelevant here.

The problem with caching the playlist (apart from having to actually write, test, and integrate the code) is that at least I don't see an obvious way to detect changed titles or changed playlists in general. I may be mistaken, so feel free to suggest code that caches the playlist results.

What really would help here is #1816, but we still have to download the playlist itself. We may do that asynchronously in the future, but that may take some time.

I am not sure what your scenario is though - why do you want to download just a single video from a large playlist? This sounds like you have a program that presents a list of videos to the user. In that case, the correct action is to store the ID alongside the title, and just request the video by ID. This will then work even if a typo in the title is corrected between display and download.

I'm closing this issue now, since I don't see any way to prevent the aforementioned downsides for a cache of playlist contents, and #1816 already tracks speedup of --match-title. Feel free to suggest caching code though.

@phihag phihag closed this Nov 29, 2013
@ghost
Copy link

@ghost ghost commented Dec 2, 2013

Although my issue isn't with --match-title and more with --dateafter (Referred to from #1816), it would SEEM (I've done very little work with Youtube, however, so, I may be wrong) that all videos are in chronological order, as shown here:-

[download] [download] 2013-11-29 upload date is not in range 2013-12-01 - 9999-12-31
[download] [download] 2013-11-27 upload date is not in range 2013-12-01 - 9999-12-31
[download] [download] 2013-11-25 upload date is not in range 2013-12-01 - 9999-12-31
[download] [download] 2013-11-24 upload date is not in range 2013-12-01 - 9999-12-31
[download] [download] 2013-11-23 upload date is not in range 2013-12-01 - 9999-12-31

So, the second it matches one that's out of date, shouldn't it just pack up, break the loop, and be done?

@lgrn lgrn mentioned this issue Jul 22, 2017
4 of 4 tasks complete
AndrewAmmerlaan added a commit to AndrewAmmerlaan/vidify that referenced this issue Apr 17, 2020
took me some time to figure out what was wrong,
but the solution is easy so I figured it might be useful to add to the FAQ

vidify#96
ytdl-org/youtube-dl#6451 (comment)
ytdl-org/youtube-dl#1846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.