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

Some files get a "NA" string for the %(upload_date)s variable sometimes. This results in the -w or --no-overwrites flag not working. #2911

Closed
GijsTimmers opened this issue May 13, 2014 · 14 comments

Comments

@GijsTimmers
Copy link

@GijsTimmers GijsTimmers commented May 13, 2014

[user@Xubuntu ~]$ youtube-dl --version
2014.05.05

I'm using youtube-dl as a client to get the latest episodes from YouTube channels. I'm using the -w flag so that files don't have to be redownloaded every time. I'm using the -o flag with "%(upload_date)s_%(title)s.%(ext)s" as its argument. Sometimes, youtube-dl is unable to get the date from a video. The upload_date string will be replaced by 'NA' and because NA_Hottest_New_Jam.mp4 differs from 20140218_Hottest_New_Jam.mp4, the file will be re-downloaded and I'll get a duplicate file in my video download directory. This is not what I want.

Possible bugfix: ignore the upload_date string when comparing filenames if the upload_date string can't be fetched.

@phihag
Copy link
Contributor

@phihag phihag commented May 13, 2014

Ignoring some part of the templates could become arbitrarily complicated. The --no-overwrites flag works fine, too, although I'd rather see it removed. For example, the way you seem to be calling it is totally unnecessary, as youtube-dl will do the smart thing and already not overwrite any existing files without it. You may be confusing its functionality with --download-archive.

Apart from that, can you post the output you get with the -v --dump-intermediate-pages options that shows the upload_date being detected as NA?

@GijsTimmers
Copy link
Author

@GijsTimmers GijsTimmers commented May 13, 2014

I understand. I checked the behaviour without the --no-overwrites flag and it looks like it doesn't make a difference indeed.

I didn't know about the command-line option --download-archive; I'll look into that.

Also, the 'NA' thing happens sporadically. I can't really say when. If I see it happening though, I'll post the information you requested right here.

@5moufl
Copy link
Contributor

@5moufl 5moufl commented May 16, 2014

I'm also getting NA for the original date using
youtube-dl -o "%(uploader)s/%(upload_date)s-%(title)s.%(ext)s" https://www.youtube.com/user/dailygrace --dateafter 20110622 --datebefore 20140205 --playlist-start 70 -i
using 2014.05.13

@phihag
Copy link
Contributor

@phihag phihag commented May 16, 2014

@5moufl someUserUrl is not a valid URL nor YouTube ID. Can you post an actual URL that exhibits the problem?

@5moufl
Copy link
Contributor

@5moufl 5moufl commented May 16, 2014

I updated my previous post. I thought It was happening for every youtube user.

@GijsTimmers
Copy link
Author

@GijsTimmers GijsTimmers commented May 16, 2014

It's happening again, today. It's only happening on YouTube; other websites, like SoundCloud, are not affected.

I posted the output here.

@phihag phihag closed this in beee53d May 16, 2014
@GijsTimmers
Copy link
Author

@GijsTimmers GijsTimmers commented May 16, 2014

Thank you!

@phihag
Copy link
Contributor

@phihag phihag commented May 16, 2014

Fixed in youtube-dl 2014.05.16.1. Type youtube-dl -U to update.

@GijsTimmers
Copy link
Author

@GijsTimmers GijsTimmers commented May 16, 2014

The provided fix worked for the Ray William Johnsson channel, but not for The Black Philip Show. I posted the output here.

jaimeMF added a commit that referenced this issue May 16, 2014
…uploader-info' element (#2911)
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 16, 2014

The webpage uses another format for the upload date, it will be correctly extracted in the next version.

@phihag
Copy link
Contributor

@phihag phihag commented May 16, 2014

@jaimeMF's changes have made it into youtube-dl 2014.05.17. Type youtube-dl -U to update.

@kmel-de
Copy link

@kmel-de kmel-de commented May 19, 2014

.16.1 says "youtube-dl is up-to-date (2014.05.16.1)"

After patching to .17 "NA" is now a date. Well done.

@GijsTimmers
Copy link
Author

@GijsTimmers GijsTimmers commented May 19, 2014

I just updated to 2014.05.19. It works now. Thank you for providing a fix.

@alimirjamali
Copy link
Contributor

@alimirjamali alimirjamali commented May 19, 2014

I was hitting my head against wall before reading this post. Since I use youtube-dl through TOR network, I though it should have something to do with my internet connection. Now it is fixed. Thank you for the fixes.

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