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

youtube-dl -g for twitter videos gives link to m3u8 file #10668

Closed
vaibhav1312 opened this issue Sep 15, 2016 · 10 comments
Closed

youtube-dl -g for twitter videos gives link to m3u8 file #10668

vaibhav1312 opened this issue Sep 15, 2016 · 10 comments
Labels

Comments

@vaibhav1312
Copy link

@vaibhav1312 vaibhav1312 commented Sep 15, 2016

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

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.

  • I've verified and I assure that I'm running youtube-dl 2016.09.15

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

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 ```):

$ youtube-dl -v -g 'https://twitter.com/YesIamSaffron/status/776475475858173954'
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'-g', u'https://twitter.com/TrollKejri/status/776307587314614272']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.08.10
[debug] Python version 2.7.10 - Darwin-15.4.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.0, ffprobe 3.0
[debug] Proxy map: {}
https://video.twimg.com/amplify_video/776444641944010752/pl/640x360/KDt2ddRttDFduxGV.m3u8
<end of log>

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.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Sep 15, 2016

It gives you a link to whatever is served by twitter.

@dstftw dstftw closed this Sep 15, 2016
@dstftw dstftw added the invalid label Sep 15, 2016
@vaibhav1312
Copy link
Author

@vaibhav1312 vaibhav1312 commented Sep 15, 2016

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

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Sep 15, 2016

No mp4 for me in browser.

@vaibhav1312
Copy link
Author

@vaibhav1312 vaibhav1312 commented Sep 16, 2016

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.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 16, 2016

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.

@vaibhav1312
Copy link
Author

@vaibhav1312 vaibhav1312 commented Sep 16, 2016

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

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 16, 2016

It requires writing new codes.

@vaibhav1312
Copy link
Author

@vaibhav1312 vaibhav1312 commented Sep 16, 2016

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

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 16, 2016

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?

@vaibhav1312
Copy link
Author

@vaibhav1312 vaibhav1312 commented Sep 16, 2016

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.

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.