aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/tweakers.py
blob: 4bbe76e964b058c1c5ea05e3439042b1f076bdd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from __future__ import unicode_literals

from .common import InfoExtractor
from ..utils import (
    xpath_text,
    xpath_with_ns,
    int_or_none,
    float_or_none,
)


class TweakersIE(InfoExtractor):
    _VALID_URL = r'https?://tweakers\.net/video/(?P<id>\d+)'
    _TEST = {
        'url': 'https://tweakers.net/video/9926/new-nintendo-3ds-xl-op-alle-fronten-beter.html',
        'md5': '1b5afa817403bb5baa08359dca31e6df',
        'info_dict': {
            'id': '9926',
            'ext': 'mp4',
            'title': 'New Nintendo 3DS XL - Op alle fronten beter',
            'description': 'md5:f97324cc71e86e11c853f0763820e3ba',
            'thumbnail': 're:^https?://.*\.jpe?g$',
            'duration': 386,
        }
    }

    def _real_extract(self, url):
        playlist_id = self._match_id(url)
        entries = self._extract_xspf_playlist(
            'https://tweakers.net/video/s1playlist/%s/playlist.xspf' % playlist_id, playlist_id)
        return self.playlist_result(entries, playlist_id)