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

Write to --download-archive if date is not in range or matched reject pattern #2832

Open
marquesLuis opened this issue Apr 29, 2014 · 7 comments
Open
Labels

Comments

@marquesLuis
Copy link

@marquesLuis marquesLuis commented Apr 29, 2014

My proposal is to add some option like --write-anyway that would write the ID to the download archive folder. This way in future operations, would be processed faster because it would not need to open connection and would skip it locally.

Thank you for your great job

@jaimeMF jaimeMF added the request label Apr 29, 2014
@TheLoneWolfling
Copy link

@TheLoneWolfling TheLoneWolfling commented Jan 8, 2016

I was going to write a bug report about this.

But it's already here, it seems.

Anyways, seconded!

(Alternatively, I would like a switch that enabled writing to the archive even if downloading is otherwise disabled.)

@konomikitten
Copy link

@konomikitten konomikitten commented Sep 28, 2018

I would definitely appreciate this being added as I just want to skip to the latest videos you can use --dateafter but it makes the process much slower.

@konomikitten
Copy link

@konomikitten konomikitten commented Sep 28, 2018

Workaround for anyone that wants to bypass this issue:

youtube-dl --ignore-errors --simulate --get-id [URL] | sed 's/\(.*\)/youtube \1/' > archive.txt

@twiclo
Copy link

@twiclo twiclo commented Nov 6, 2019

Does anyone know at what point it stops looking for IDs in the archives file? Surely it doesn't go back 3000 videos to make sure that ID is in the archive.txt

@konomikitten
Copy link

@konomikitten konomikitten commented Nov 6, 2019

@twiclo it will go all the way to the start last I checked, if you use any filters to skip a video it will not add the ID to the archive file, it seems to only add the ID on download.

@twiclo
Copy link

@twiclo twiclo commented Nov 6, 2019

I generated a small archive.txt that surely wasn't filled with all of Styx's 3K+ videos and when I ran the command again it said it was only downloading 33. So there's a limit I'm interested to see what it is. I tried looking at the source code and really couldn't understand the organization for the flag

@konomikitten
Copy link

@konomikitten konomikitten commented Nov 6, 2019

I generated a small archive.txt that surely wasn't filled with all of Styx's 3K+ videos and when I ran the command again it said it was only downloading 33. So there's a limit I'm interested to see what it is. I tried looking at the source code and really couldn't understand the organization for the flag

Does for me

Version:

$ youtube-dl --version
2019.11.05

Example (Interuppted because I don't want to wait for it to check datestamp of 2000+ videos.

$ youtube-dl --ignore-config --download-archive JimSterling --simulate --dateafter 20191106 https://www.youtub
e.com/user/JimSterling
[youtube:user] JimSterling: Downloading channel page
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading webpage
[download] Downloading playlist: Uploads from Jim Sterling
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #1
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #2
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #3
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #4
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #5
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #6
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #7
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #8
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #9
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #10
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #11
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #12
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #13
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #14
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #15
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #16
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #17
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #18
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #19
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #20
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #21
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #22
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #23
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #24
[youtube:playlist] playlist Uploads from Jim Sterling: Downloading 2402 videos
[download] Downloading video 1 of 2402
[youtube] VMiY2f0DRSg: Downloading webpage
[youtube] VMiY2f0DRSg: Downloading video info webpage
[download] 2019-11-05 upload date is not in range 2019-11-06 - 9999-12-31
[download] Downloading video 2 of 2402
[youtube] jiOCyTsg-yo: Downloading webpage
[youtube] jiOCyTsg-yo: Downloading video info webpage
[download] 2019-11-04 upload date is not in range 2019-11-06 - 9999-12-31
[download] Downloading video 3 of 2402
[youtube] -T2_PU8rHtk: Downloading webpage
[youtube] -T2_PU8rHtk: Downloading video info webpage
[download] 2019-11-02 upload date is not in range 2019-11-06 - 9999-12-31
[download] Downloading video 4 of 2402
[youtube] yWhQXvuOeLw: Downloading webpage
[youtube] yWhQXvuOeLw: Downloading video info webpage
[download] 2019-11-01 upload date is not in range 2019-11-06 - 9999-12-31
[download] Downloading video 5 of 2402
[youtube] -ScQuKXFPs0: Downloading webpage
[youtube] -ScQuKXFPs0: Downloading video info webpage
[download] 2019-10-30 upload date is not in range 2019-11-06 - 9999-12-31
[download] Downloading video 6 of 2402
[youtube] qwWGQ4Q6KFA: Downloading webpage
^C
ERROR: Interrupted by user

To clarify this is without --simulate, you can see that when a video is skipped because it's date is not in range the IDs are not written to the archive file (meaning that every time this runs it's going to check every single video again):

$ youtube-dl --ignore-config --download-archive JimSterling --dateafter 20191106 https://www.youtube.com/user/
JimSterling
[youtube:user] JimSterling: Downloading channel page
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading webpage
[download] Downloading playlist: Uploads from Jim Sterling
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #1
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #2
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #3
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #4
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #5
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #6
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #7
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #8
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #9
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #10
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #11
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #12
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #13
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #14
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #15
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #16
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #17
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #18
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #19
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #20
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #21
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #22
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #23
[youtube:playlist] UUWCw2Sd7RlYJ2yuNVHDWNOA: Downloading page #24
[youtube:playlist] playlist Uploads from Jim Sterling: Downloading 2402 videos
[download] Downloading video 1 of 2402
[youtube] VMiY2f0DRSg: Downloading webpage
[youtube] VMiY2f0DRSg: Downloading video info webpage
[download] 2019-11-05 upload date is not in range 2019-11-06 - 9999-12-31
[download] Downloading video 2 of 2402
[youtube] jiOCyTsg-yo: Downloading webpage
[youtube] jiOCyTsg-yo: Downloading video info webpage
[download] 2019-11-04 upload date is not in range 2019-11-06 - 9999-12-31
[download] Downloading video 3 of 2402
[youtube] -T2_PU8rHtk: Downloading webpage
[youtube] -T2_PU8rHtk: Downloading video info webpage
[download] 2019-11-02 upload date is not in range 2019-11-06 - 9999-12-31
[download] Downloading video 4 of 2402
[youtube] yWhQXvuOeLw: Downloading webpage
^C
ERROR: Interrupted by user

$ ls JimSterling
ls: cannot access 'JimSterling': No such file or directory

Edit: Date is a poor example in a few ways due to the most recent videos being first you can imagine if the filter you're running is looking for more specific conditions that require going through every video. The original request is valid but more so youtube-dl should only skip writing the ID if there is an error not if the video was downloaded.

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
5 participants
You can’t perform that action at this time.