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

Possible to get the file paths of all files related to a video downloaded with youtube-dl #25470

Open
graham-walker opened this issue May 31, 2020 · 0 comments
Labels

Comments

@graham-walker
Copy link

@graham-walker graham-walker commented May 31, 2020

Checklist

  • [ x] I'm asking a question
  • [ x] I've looked through the README and FAQ for similar questions
  • [ x] I've searched the bugtracker for similar questions including closed ones

Question

I'm writing a script that passes metadata and file locations for videos, thumbnails, subtitles, etc. downloaded by youtube-dl into a database. The script is run by the --exec option in youtube-dl and gets passed the name of the video downloaded as an argument. The video name is then used to find other files related to the video (for example, removing the video file extension and replacing it with .info.json to find the file created by --write-info-json).

However, I'm running into trouble when it comes to indexing thumbnails and subtitles. For example, thumbnails across many different extractors don't have predictable file extensions or names (if there are multiple thumbnails) making it difficult to identify which files are what type and go in what order.

In the case of my script I believe it may be possible to guess the thumbnail name with a high degree of accuracy (using information from .info.json check "thumbnails" for the thumbnail ext in the "url", checking the "url" response header for ext, if there are more then one thumbnails add the "id" to the guessed file name, etc.) however this could be prone to sometimes being wrong and I hope there is a better way to do this.

I'm curious to see if there is another way of getting all of the files related to the video downloaded by youtube-dl and to tell what type of files they are (thumbnails, subtitles, metadata, etc.). I did not see a way to do this in the README or FAQ.

If there is no way of doing this a possible solution could be adding a parameter like --write-files-list which would write the all files downloaded by youtube-dl when downloading the video to videoname.files.json.

"video": "path"
"thumbnails": [
    "path",
    "path"
]
"subtitles": [
...
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
1 participant
You can’t perform that action at this time.