Accessing the downloaded file. #11603

Closed
opened 2026-02-21 05:01:31 -05:00 by deekerman · 8 comments
Owner

Originally created by @Joaobranquinho on GitHub (Aug 26, 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?

Originally created by @Joaobranquinho on GitHub (Aug 26, 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?
Author
Owner

@siddht4 commented on GitHub (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

@siddht4 commented on GitHub (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
Author
Owner

@dstftw commented on GitHub (Aug 27, 2017):

_filename field of video info dict.

@dstftw commented on GitHub (Aug 27, 2017): `_filename` field of video info dict.
Author
Owner

@Joaobranquinho commented on GitHub (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

@Joaobranquinho commented on GitHub (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`
Author
Owner

@siddht4 commented on GitHub (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

@siddht4 commented on GitHub (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
Author
Owner

@siddht4 commented on GitHub (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 commented on GitHub (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
Author
Owner

@siddht4 commented on GitHub (May 19, 2018):

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

@siddht4 commented on GitHub (May 19, 2018): For ffmpeg just make sure its set to global path. Explicitly mentioning is not required
Author
Owner

@siddht4 commented on GitHub (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 commented on GitHub (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.
Author
Owner

@siddht4 commented on GitHub (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

@siddht4 commented on GitHub (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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#11603
No description provided.