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

How to embed subtitles and embed thumbnail when using youtube-dl as a library #25616

Closed
ExeArco opened this issue Jun 11, 2020 · 4 comments
Closed

Comments

@ExeArco
Copy link

@ExeArco ExeArco commented Jun 11, 2020

Checklist

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

Question

I cannot seem to be able to emulate the following command line execution of youtube-dl when using youtube-dl as a library.
youtube-dl --write-sub --embed-subs --write-thumbnail --embed-thumbnail --merge-output-format mp4 https://www.youtube.com/watch?v=XXXXXXXXXXXX

I have tried the following as my ydl_opts

ydl_opts = {
	'format' : 'bestvideo+bestaudio',
	"writedescription" : "true",
	"writesubtitles" : True,
	"embed-subs" : True,
	'writeinfojson': True,
	"writethumbnail" : True,
	"outtmpl" : "Downloads/%(title)s.%(ext)s)",
	"logger": MyLogger(),
	'postprocessors': [{
		'key': 'FFmpegVideoConvertor',
		'preferedformat': 'mp4',  # one of avi, flv, mkv, mp4, ogg, webm
	},{
		'key': 'FFmpegMetadata'
    }
	],
}

This does embed subtitles or thumbnails. I can get the behaviour that I desire by running this from the command line but not using youtube-dl as a library.

@ExeArco ExeArco added the question label Jun 11, 2020
@dstftw dstftw closed this Jun 11, 2020
@dstftw dstftw added the duplicate label Jun 11, 2020
@ExeArco
Copy link
Author

@ExeArco ExeArco commented Jun 11, 2020

Where is the duplicate issue if this is a duplicate?

@ExeArco
Copy link
Author

@ExeArco ExeArco commented Jun 11, 2020

just ended up using a sub process call anyway

@uyouthe
Copy link

@uyouthe uyouthe commented Sep 22, 2020

@ExeArco me too. It seems like he closes our issues just because he can.

@ExeArco
Copy link
Author

@ExeArco ExeArco commented Sep 22, 2020

@uyouthe I'd have no problem with him closing it if there was either proper documentation on using youtube-dl as a library, because as it stands the current documentation could be written on an index card or if he'd link the supposed duplicate of this issue.
I ended up just using a subprocess call as this wasn't worth getting angry over.

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.