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

[SkylineWebcamsIE] Attempt to fix extractor, should investigate further #32421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Microeinstein
Copy link

Please follow the guide below

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

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

SkylineWebcams support is broken — I got the following output trying a random webcam:

$ youtube-dl -vU 'https://www.skylinewebcams.com/it/webcam/espana/canarias/santa-cruz-de-tenerife/playa-los-cristianos.html'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-vU', 'https://www.skylinewebcams.com/it/webcam/espana/canarias/santa-cruz-de-tenerife/playa-los-cristianos.html']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.11.3 (CPython) - Linux-6.2.10-1-clear-x86_64-with-glibc2.37
[debug] exe versions: ffmpeg 6.0, ffprobe 6.0
[debug] Proxy map: {}
It looks like you installed youtube-dl with a package manager, pip, setup.py or a tarball. Please use that to update.
[SkylineWebcams] playa-los-cristianos: Downloading webpage
ERROR: Unable to extract stream url; 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.
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/youtube_dl/YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
                ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/skylinewebcams.py", line 28, in _real_extract
    stream_url = self._search_regex(
                 ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/common.py", line 1012, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract stream url; 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.

The raw stream url is now source:'livee.m3u8?a=abcd1234...' — I tried to fix the regex, then noticed the base domain did not appear in the stream url and fixed that too, but it doesn't suffice. Inspecting network requests there's no livee.m3u8 but various ones to https://hd-auth.skylinewebcams.com/live, so also tried to do a simple replace and it seems working now.

Needless to say it's a pretty hackish approach and it should be investigated further.

@dirkf
Copy link
Contributor

dirkf commented Jul 18, 2023

You're on to something here. The player JS loaded by the page has this fragment:

_.prototype._normalizeSources = function (e) {
  var t = e.sources || (void 0 !== e.source ? [
    'https://hd-auth.skylinewebcams.com/' + e.source.replace('livee.', 'live.')
  ] : [
  ]);

@Microeinstein
Copy link
Author

Oh! That's nice 😄 Should I/we reflect the same exact logic into youtube-dl?

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

Successfully merging this pull request may close these issues.

None yet

2 participants