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 not reporting the final filename #5602

Closed
kereilly opened this issue May 4, 2015 · 2 comments
Closed

youtube-dl not reporting the final filename #5602

kereilly opened this issue May 4, 2015 · 2 comments

Comments

@kereilly
Copy link

@kereilly kereilly commented May 4, 2015

I'm a novice at writing python but i did write a program that was working until about a week or so ago. It seems after i updated youtube-dl it no longer reports the final filename. here is my hook:

def my_hook(d):
if d['status'] == 'finished':
print "\nYour video has been downloaded!"
filelocation = d['filename']
print filelocation

When i run the script i'll get:
Your video has been downloaded!
/Volumes/RR261-GOING-POSTAL_1/RR261_Archival_Footage/RR261_A999_Erase_Please.f243.webm

Your video has been downloaded!
/Volumes/RR261-GOING-POSTAL_1/RR261_Archival_Footage/RR261_A999_Erase_Please.f141.m4a

So according to the documentation i've got two choices to get filenames

  • filename: The final filename (always present)
  • tmpfilename: The filename we're currently writing to

shouldn't filename report back the remuxed file that results, which in this case is RR261_A999_Erase_Please.mkv or is this not the way to get the file name that was downloaded. Thanks

@SleepProgger
Copy link

@SleepProgger SleepProgger commented Jul 14, 2015

You can get the resulting filename via the prepare_filename function (for example).

# Download the file and get the info
info = ydl.extract_info(download=False)
print "filename", ydl.prepare_filename(info)
@kereilly
Copy link
Author

@kereilly kereilly commented Jul 21, 2015

Thanks a bunch. This was exactly what i needed.

On Mon, Jul 13, 2015 at 11:45 PM, SleepProgger notifications@github.com
wrote:

You can get the resulting filename via the prepare_filename function
(for example).

Download the file and get the info

info = ydl.extract_info(download=False)
print "filename", ydl.prepare_filename(info)


Reply to this email directly or view it on GitHub
#5602 (comment).

@dstftw dstftw closed this May 20, 2016
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
3 participants
You can’t perform that action at this time.