python, nativeMessagingHost, youtube-dl, ffmpeg
-
Hey there,
i was working on some cool stuff to download audio from all sites, youtube-dl is supporting.
i use native messaging hosts where a python script handles the url. There the youtube-dl libraries are embedded.
script looks like this:
path = "/home/user/Downloads/" destination = path+'%(title)s.%(ext)s' ydl_opts = { 'format': 'bestaudio', 'noplaylist' : True, 'outtmpl': destination, 'verbose': True, 'keepvideo': True, 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '192', }], } with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([url])
Problem is, on Chrome/Chromium/Opera everything works. On Vivaldi i got the following error:
ERROR:root:Traceback (most
recent call last):
File "/usr/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 1942, in post_process
files_to_delete, info = pp.run(info)
File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 530, in run
self.run_ffmpeg(filename, temp_filename, options)
File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 208, in run_ffmpeg
self.run_ffmpeg_multiple_files([path], out_path, opts)
File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 204, in run_ffmpeg_multiple_files
raise FFmpegPostProcessorError(msg)
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: ERROR: Did you mean file:file:/home/user/testvideo.m4a?The Video gets downloaded, but the ffmpegExtract doesn't work because somehow a "file:" is put twice in front of the Path, wich, i guess, is the cause for the fail.
Does Vivaldi use some other (python)environment? What can be the reason, python reacts different in vivaldi than in other chrome-related browsers?
-
I was looking into an issue and noticed that vivaldi starts by a script which modifies LD_LIBRARY_PATH in order to locate a compatible ffmpeg runtime. That might be worth investigating.
-
thank you Steve, that's the first hint i got in weeks.
I will have a look into this. -
i got it to work.
But only if i remove the vivaldi-ffmpeg-codecs package, which brings /opt/vivaldi/lib/libffmpeg.soi use opera and chromium and both have also a *-ffmpeg-codecs package, but they work as expected.
So i need some workarround for my script to work with the native ffmpeg from system or there is a bug in libffmpeg.so
-
here you go:
https://aur.archlinux.org/packages/?O=0&K=vivaldii always use the newest version.
But for that i have to make the package, including the complete source of chromium, which takes ~20 min. to build.Do yo know how to bypass libffmpeg.so and use native ffmpeg in order to get python scripts working?
-
Sorry, i meant "Do you know...".
So you don't know Neither do i.Awesome because of the size?
It's fucking nasty to do this every time, but it's quite an easy job in Arch, the PKGBUILDs are well prepared. -
i'm not able to do this, that's way to hard.
Do you think, this is a bug?
-
they say it's external bug. Even if native ffmpeg is used, the same error comes up.
-
Where can i write to devs who are responsible for libffmpeg.so?
chromium is doing well as i said.
-
Arch Linux
-
As long as this is "just" an AUR Package (not officially supported) it's not a case for the arch bug tracker system.
I wrote to the package maintainer and started a thread in the Arch forum, if somebody is interested in this:
https://bbs.archlinux.org/viewtopic.php?pid=1715773#p1715773 -
-