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

Site support request - tv.vera.com.uy #18872

Open
5 of 9 tasks
thepante opened this issue Jan 16, 2019 · 2 comments
Open
5 of 9 tasks

Site support request - tv.vera.com.uy #18872

thepante opened this issue Jan 16, 2019 · 2 comments

Comments

@thepante
Copy link

  • I've verified and I assure that I'm running youtube-dl 2019.01.16
  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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
➜ youtube-dl -v http://tv.vera.com.uy/video/38565
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'http://tv.vera.com.uy/video/38565']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.01.16
[debug] Python version 2.7.15+ (CPython) - Linux-4.18.0-10-generic-x86_64-with-Ubuntu-18.10-cosmic
[debug] exe versions: ffmpeg 4.0.2-2, ffprobe 4.0.2-2, phantomjs 5, rtmpdump 2.4
[debug] Proxy map: {}
[generic] 38565: Requesting header
WARNING: Falling back on generic information extractor.
[generic] 38565: Downloading webpage
[generic] 38565: Extracting information
ERROR: Unsupported URL: http://tv.vera.com.uy/video/38565
Traceback (most recent call last):
  File "/home/pante/.local/lib/python2.7/site-packages/youtube_dl/extractor/generic.py", line 2337, in _real_extract
    doc = compat_etree_fromstring(webpage.encode('utf-8'))
  File "/home/pante/.local/lib/python2.7/site-packages/youtube_dl/compat.py", line 2542, in compat_etree_fromstring
    doc = _XML(text, parser=etree.XMLParser(target=_TreeBuilder(element_factory=_element_factory)))
  File "/home/pante/.local/lib/python2.7/site-packages/youtube_dl/compat.py", line 2531, in _XML
    parser.feed(text)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1659, in feed
    self._raiseerror(v)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1523, in _raiseerror
    raise err
ParseError: mismatched tag: line 96, column 2
Traceback (most recent call last):
  File "/home/pante/.local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 793, in extract_info
    ie_result = ie.extract(url)
  File "/home/pante/.local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 508, in extract
    ie_result = self._real_extract(url)
  File "/home/pante/.local/lib/python2.7/site-packages/youtube_dl/extractor/generic.py", line 3320, in _real_extract
    raise UnsupportedError(url)
UnsupportedError: Unsupported URL: http://tv.vera.com.uy/video/38565

-

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

I tried to do it by myself but I have little/no-deep python knowledge, so ended up being realistic...

The site is tv.vera.com.uy - but has a second domain, veramas.com.uy - It's the same portal, some of their videos are accessible by the two domains, other videos are not and available on only one (that's why I put those two domains).

The site is the author of the content or/its authorized to show it. It's legal, state service.

@thepante
Copy link
Author

thepante commented Feb 1, 2019

I keep trying, I'm stuck with this: gist - vera.py
I test directly, check:

youtube-dl  vera  
➜ python -m youtube_dl http://tv.vera.com.uy/video/38478 --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'http://tv.vera.com.uy/video/38478', u'--verbose']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.01.16
[debug] Git HEAD: bfc8eeea5
[debug] Python version 2.7.15+ (CPython) - Linux-4.18.0-10-generic-x86_64-with-Ubuntu-18.10-cosmic
[debug] exe versions: ffmpeg 4.0.2-2, ffprobe 4.0.2-2, phantomjs 5, rtmpdump 2.4
[debug] Proxy map: {}
[Vera] 38478: Downloading webpage
===========
http://tv.vera.com.uy/video/38478
Trailer 4
"Todos detrás de Momo", una serie del Programa SeriesUy. Mirala por vera+, TNU y TV Ciudad.
mp4
38478
===========
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on u'http://tv.vera.com.uy/video/38478'
[download] Destination: Trailer 4-38478.mp4
[download] 100% of 40.02KiB in 00:00

As you can see, the result is saved as Trailer 4-38478.mp4, which its the HTML of that url in a pseudo mp4 file.

How I can get the video (m3u8) saved as mp4/mkv/whatever?

How can I extract it? I can see the m3u8 file inside an <iframe> with id iframePlayerContent, then inside of that, in javascript, the function embedPlayersourcehls


In video page HTML, there is:

buildPlayer = function(){
  $("#player_content").html('').append('<iframe class="iframeclass content-watch" id="iframePlayerContent" frameborder="0" scrolling="no" src="" webkitallowfullscreen="true" mozallowfullscreen="true" allowFullScreen="true"></iframe>');
  $('#iframePlayerContent').attr('src', 'http://tv.vera.com.uy/syndication/index.php/sindicacion/play/ANTEL-PLAYER/38478?extras=eyJ3aWR0aCI6IjEwMCUiLCJoZWlnaHQiOiIxMDAlIiwiaWZyYW1lZCI6MSwic2VjdXJpdHlfdG9rZW4iOiJaakl6WkRabU1UYzNNak0zTmpBd1pXSmtaV0kwWVdSbFltVmhNekJqWWpRNU5ERmlOak0yWmc9PSIsIndzX3Rva2VuIjoie1wid3NfdG9rZW5cIjpcImV5SjFjMlZ5WDJsa0lqcG1ZV3h6WlN3aWFYTmZjbTl2ZENJNlptRnNjMlVzSW1sd0lqb2lNVFkzTGpVM0xqY3dMalF6SWl3aWJHOW5aMlZrSWpvd0xDSjBlV01pT21aaGJITmxMQ0pqYjI1MFpXNTBYMmxrSWpvaU16ZzBOemdpTENKa2FYSjBJam9pTVRVME9EazVNamN5TlRnNE1UY2lMQ0p6YVdkdUlqb2lPR1l3T1RrMVpUUTNaR0l4WlRCak56RXhZVFExTWpjMVpqTm1ZMlUwT1dGalpqTmtZbVpsWVdFNU0yWTBNV1UwWXpKak5qa3hNV015TVdVMU5HUmlaaUo5XCJ9In0=');
}

Then inside that src there, you find this ↓

function embedPlayer(){
  var conf = {
  "key":"a488d68f-aedf-4be7-b687-23403ecb4520",
  "playback":{"autoplay": true,"muted": false},
  "style": {"ux":true,"width": "100%","height": "100%"},
  "source":{"hls": "http://vxvod3.cdn.antel.net.uy/auth_38478,vxttoken=cGF0aFVSST0lMkZhdXRoXzM4NDc4JTJGdnhmbXQlM0RobHMlMkYlMkEmZXhwaXJ5PTE1NDkwMDg0OTUmcmFuZG9tPXU3a0NmVFIzcXgmYy1pcD0xNjcuNTcuNzAuNDMsYzk2YTY3ZjMxYmNjMjc1M2E3YTE0Zjc0MmM5OWZkZDc0NzBhNWM5NDhlMDYzNzQ2OWExNGE0MzkwNDNkMWUxMg==/vxfmt=hls/playlist.m3u8",
    "tracks": [{"file":"http://veratvimgs.cdn.antel.net.uy/dynamic/content_images/38478/96/preview_thumbs.vtt","kind":"thumbnails"}]
  }
};
				

So how I continue with this? I have no clue

@thepante
Copy link
Author

thepante commented Feb 2, 2019

I finally could. In a way I think is really gross(?, but it does work: gist
How can I clean it? I know there is redundant code.

As can see there, it does this:

  1. First get the URL and download it
  2. Convert it to plain HTML
  3. Search for links that does have specific word that I saw there for the iframe
  4. It loads that second URL
  5. Searches for ".m3u8" link inside that second loaded page (iframe)
  6. Assign that source to video_url

This is supporting two domains from the same service, but the secondary domain has different html so I have to do some sort of ifs that I'm not sure how to do, but, I'll see...

Suggestions?

I'm talking alone, I don't care have a nice day xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant