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

Support for live TV on EinsUndEinsTV (Zattoo derivate) #22248

Closed
EugenVau opened this issue Aug 28, 2019 · 3 comments
Closed

Support for live TV on EinsUndEinsTV (Zattoo derivate) #22248

EugenVau opened this issue Aug 28, 2019 · 3 comments

Comments

@EugenVau
Copy link

@EugenVau EugenVau commented Aug 28, 2019

  • I'm reporting a site feature request
  • I've verified that I'm running youtube-dl version 2019.08.13
  • I've searched the bugtracker for similar site feature requests including closed ones

Description

Would be nice to have live TV support for "EinsUndEinsTV" in the Zattoo extractor. The URL structure is exactly like in ZattooLive or QuicklineLive, e.g. https://www.1und1.tv/watch/zdf.

Many thanks and keep on the great work!

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 28, 2019

You must provide account credentials.

@dstftw dstftw closed this Aug 28, 2019
@EugenVau
Copy link
Author

@EugenVau EugenVau commented Aug 29, 2019

Hi @dstftw ,

thanks for your quick reaction!

Unfortunately, I cannot provide my personal account credentials for obvious reasons. Neither can I set up a toolchain for building YTDL myself :-(

But I can suggest changes in the Zattoo extractor, that pretty sure will work for 1und1.tv live TV and offer myself testing any eventual dev-builds, if needed.

As for code changes, the EinsUndEinsTVIE class in the Zattoo extractor should be replaced by the following code:

class EinsUndEinsTVBaseIE(ZattooIE):
    _NETRC_MACHINE = '1und1tv'
    _HOST = '1und1.tv'
    _API_HOST = 'www.%s' % _HOST


class EinsUndEinsTVIE(EinsUndEinsTVBaseIE):
    _VALID_URL = _make_valid_url(ZattooIE._VALID_URL_TEMPLATE, _HOST)

    _TESTS = [{
        'url': 'https://www.1und1.tv/watch/abc/123-abc',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        channel_name, video_id, record_id = re.match(self._VALID_URL, url).groups()
        return self._extract_video(channel_name, video_id, record_id)


class EinsUndEinsTVLiveIE(EinsUndEinsTVIE):
    _VALID_URL = r'https?://(?:www\.)?1und1\.tv/watch/(?P<id>[^/]+)'

    _TEST = {
        'url': 'https://www.1und1.tv/watch/zdf',
        'only_matching': True,
    }

    @classmethod
    def suitable(cls, url):
        return False if EinsUndEinsTV.suitable(url) else super(EinsUndEinsTVLiveIE, cls).suitable(url)

    def _real_extract(self, url):
        channel_name = video_id = self._match_id(url)
        return self._extract_video(channel_name, video_id, is_live=True)
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 29, 2019

The only option is providing credentials. I don't merge untested 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
2 participants
You can’t perform that action at this time.