ruuk / script.module.youtube.dl

⛔️ DEPRECATED: Access to youtube-dl stream extraction in an XBMC module
GNU General Public License v2.0
39 stars 40 forks source link

Add merge capability #57

Closed jmzambon closed 3 years ago

jmzambon commented 4 years ago

Hi ruuk,

Some sites (francetv.fr notably) only provides separate audio and video files. The youtube-dl plugin does not support separate files and download a single video-only stream, without audio track (see issue in this project: https://github.com/Catch-up-TV-and-More/plugin.video.catchuptvandmore/issues/312). The problem lies in YDStreamExtractor.getVideoInfo (which returns the video-only url) and in YoutubeDLWrapper.download (which bypasses the merge mechanism implemented in youtubeDL.py). This pull request does not rely on getVideoInfo to get the requested video format. It uses instead the "format" option of YoutubeDL.py. I've made a lot of tests, with no problem. But I'm not aware of every edge cases. So any advice would be very appreciated.

The PR also fixes issue #55 and allows to pass a preferred name for the downloaded file. Extra parameters can also be passed to YoutubeDL throught the YoutubeDLWrapper class (mainly intended for ffmpeg-location) [overrideParam mechanism restored, I misunderstood it at first].

The current api is normally not broken. But the proposed changes allow a simpler way for calling the download script:

import YDStreamExtractor

# @quality is optional
info = {'url': 'http://www.youtube.com/watch?v=_yVv9dx88x0', 'quality': 1}

path = "/directory/where/we/want/the/video"
video_name = 'my downloaded file' 
result = YDStreamExtractor.handleDownload(info, bg=True, path=path, filename=video_name)

Thanks for all.

sy6sy2 commented 4 years ago

ping @ruuk 😉

sy6sy2 commented 3 years ago

Hi @jmzambon, Ruuk will not maintain this Kodi addon anymore and the new "origin" of Youtube-DL is now on https://github.com/Catch-up-TV-and-More/script.module.youtube.dl.

Can you close this PR and open a new one on https://github.com/Catch-up-TV-and-More/script.module.youtube.dl please? So that we will be able to merge and submit your fix on official repos. Thank you :wink:

jmzambon commented 3 years ago

Done, thank you !