Closed vaibhav1312 closed 8 years ago
It gives you a link to whatever is served by twitter.
But the m3u8 format does not play in the media player, and also there is a link to the mp4/video file "https://video.twimg.com/amplify_video/776444641944010752/vid/640x360/CRxt59VOd4NPVnMi.mp4"
So which means it mp4 format can be extracted from twitter, and also m3u8 is not a video format.
Any help would be great. Thanks
No mp4 for me in browser.
If there was a link to mp4 file in html code of tweet, I would have extracted it already. Its just the link can be accessed from api, and there must be some other way to get it.
The mp4 link is available with User-Agent: Mozilla/5.0 (Android 4.4; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0
.
But the m3u8 format does not play in the media player
Which player are you using? Both VLC and mpv works for me.
Can you just post the command with the user agent, which gives the mp4 link.
I tried this command
youtube-dl -v -g --user-agent 'Mozilla/5.0 (Android 4.4; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0.' 'https://twitter.com/YesIamSaffron/status/776475475858173954'
But its not working.
I want to give user the mp4 link, so that he/she can download the video. Thanks
It requires writing new codes.
It throws this error
File "/Users/vaibhav/git_projects/downloadenv/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 694, in extract_info ie_result = ie.extract(url) File "/Users/vaibhav/git_projects/downloadenv/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 347, in extract return self._real_extract(url) File "/Users/vaibhav/git_projects/downloadenv/lib/python2.7/site-packages/youtube_dl/extractor/twitter.py", line 294, in _real_extract username = remove_end(self._og_search_title(webpage), ' on Twitter') File "/Users/vaibhav/git_projects/downloadenv/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 762, in _og_search_title return self._og_search_property('title', html, **kargs) File "/Users/vaibhav/git_projects/downloadenv/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 750, in _og_search_property escaped = self._search_regex(og_regexes, html, name, flags=re.DOTALL, **kargs) File "/Users/vaibhav/git_projects/downloadenv/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 650, in _search_regex raise RegexNotFoundError('Unable to extract %s' % _name) RegexNotFoundError: Unable to extract OpenGraph title; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Of if you can point me to the direction of solution, that would be very helpful of you. Thank you
Just changing the User-Agent does not work. You need to modify youtube_dl/extractor/twitter.py
.
By the way, most media players I know support m3u8 URLs. Or do you want to support something like Windows Media Player?
I'm making a downloader for twitter, where user will enter the tweet url & youtube-dl will extract the mp4 link of the video file and give it to the user, so user can download directly from the twitter CDN.
Earlier youtube-dl was able to extract mp4 links, but i think twitter made some changes in its code.
Please follow the guide below
x
into all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --version
and ensure your version is 2016.09.15. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add
-v
flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):
Description of your issue, suggested solution and other information
Earlier it used to extract the link to the mp4 file, now it just gives link to m3u8 file.