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

Accessing the downloaded file. #14041

Closed
Joaobranquinho opened this issue Aug 27, 2017 · 10 comments
Closed

Accessing the downloaded file. #14041

Joaobranquinho opened this issue Aug 27, 2017 · 10 comments

Comments

@Joaobranquinho
Copy link

@Joaobranquinho Joaobranquinho commented Aug 27, 2017

I've looked through the documentation and haven't been able to locate this "feature"
I use embed youtube-dl in python. Is there anyway for me to access the just downloaded file?

@siddht4
Copy link

@siddht4 siddht4 commented Aug 27, 2017

the downloaded file should be where your embed youtube-dl project/code exists if not anyways overrided with --config-location PATH or --output TEMPLATE or config i.e https://github.com/rg3/youtube-dl#configuration.

I want to make sure you are talking about the downloaded audio/video from the embed youtube-dl,not youtube-dl code in anyways to add/import the youtube-dl project

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 27, 2017

_filename field of video info dict.

@dstftw dstftw closed this Aug 27, 2017
@Joaobranquinho
Copy link
Author

@Joaobranquinho Joaobranquinho commented Aug 27, 2017

@dstftw
After inspecting the info dict that I obtained using the code bellow:

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    info_dict = ydl.extract_info(self.url)
    pprint(info_dict)

I wasn't able to find the _filename field. All I found was filesize

@siddht4
Copy link

@siddht4 siddht4 commented Aug 28, 2017

@Joaobranquinho you need to change/modify your ydl_opts for this one

example :
ydl_opts ={ 'format': '720p/best', '_filename':'[path]/[file_name]', # [path] : means the entire folder structure, if the path , if its ignored the downloaded file will be named based on your file naming structure where your embed code is 'postprocessors': [], 'logger': MyLogger(), 'progress_hooks': [my_hook], }

If you need more information try visiting the code https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L1679 as mentioned by @dstftw

@Moriand
Copy link

@Moriand Moriand commented May 16, 2018

@siddht4 Is this great, what more options do I have with ydl_opts?

For example, I want to change the output name, get the video quality I want to download "360, 480, 720", I also want to know how I download the subtitle of the video.

Where can I place the ffmpeg folder

@siddht4
Copy link

@siddht4 siddht4 commented May 19, 2018

ydl_opts is a dictionary object for youtube-dl. You can vist https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L1679 to get all the available options. Output name aka file name can be renamed through _filename parameters. For subtitle use allsubtitle and set it to true

@siddht4
Copy link

@siddht4 siddht4 commented May 19, 2018

For ffmpeg just make sure its set to global path. Explicitly mentioning is not required

@Moriand
Copy link

@Moriand Moriand commented May 19, 2018

hello @siddht4 It is still somewhat understandable, could you say how I start or, what options do I have ?, for example: how do I get the video quality list -> 360p, 480p, 720p, 1080p.
I can put this in print, but how do I select only one of these, example 360p or 480p ?, and that only this download.
example

ydl_opts {
  '' = '' # what other options can I include, example quality of movie
}
@siddht4
Copy link

@siddht4 siddht4 commented Jun 19, 2018

@Moriand
Answering your 2nd question
{ 'format': '480p/360p}

would force youtube-dl to download 480p file format. If its not present then the next one 360p is downloaded. otherwise it will give/return error.

@siddht4
Copy link

@siddht4 siddht4 commented Jun 19, 2018

@Moriand If you really are not understanding or facing issue. Comment here. Still I am providing link to some of the exisitng embed code I have .

Code #1 https://github.com/siddht4/youtube_dl_custom/blob/master_1/test/test_2.py To download just the meta info

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