Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/peertv.py (Python)

Code before:
# coding: utf-8
from __future__ import unicode_literals

from .common import InfoExtractor


class PeerTVIE(InfoExtractor):
    IE_NAME = 'peer.tv'
    _VALID_URL = r'https?://(?:www\.)?peer\.tv/(?:de|it|en)/(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://www.peer.tv/de/841',
        # md5 hash changes
        'info_dict': {
            'id': '841',
            'ext': 'mp4',
            'title': 'Die Brunnenburg',
            'description': 'md5:4395f6142b090338340ab88a3aae24ed',
        }
    }, {
        'url': 'https://www.peer.tv/it/404',
        'info_dict': {
            'id': '404',
            'ext': 'mp4',
            'title': 'Cascate di ghiaccio in Val Gardena',
            'description': 'md5:e8e5907f236171842674e8090e3577b8',
        }
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)

        title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title').replace('\xa0', ' ')
        description = self._html_search_meta(('og:description', 'description'), webpage)

        video_key = self._html_search_regex(r'player\.peer\.tv/js/([\d\w]+)', webpage, 'video key')

        js = self._download_webpage(f'https://player.peer.tv/js/{video_key}/', video_id,
                                    headers={'Referer': 'https://www.peer.tv/'})

        session_id = self._search_regex(r'["\']session_id["\']:\s*["\']([\w\d]+)["\']', js, 'session id')

        player_webpage = self._download_webpage(

Review comment (suggestion):
```suggestion
        'info_dict': {
            'id': '841',
            'ext': 'mp4',
            'title': 'Die Brunnenburg',
            'description': 'md5:4395f6142b090338340ab88a3aae24ed',
        },
        'params': {'skip_download': 'm3u8'}
```
same for other test

Code after:
# coding: utf-8
from __future__ import unicode_literals

from .common import InfoExtractor
from ..utils import js_to_json


class PeerTVIE(InfoExtractor):
    IE_NAME = 'peer.tv'
    _VALID_URL = r'https?://(?:www\.)?peer\.tv/(?:de|it|en)/(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://www.peer.tv/de/841',
        'info_dict': {
            'id': '841',
            'ext': 'mp4',
            'title': 'Die Brunnenburg',
            'description': 'md5:4395f6142b090338340ab88a3aae24ed',
        },
    }, {
        'url': 'https://www.peer.tv/it/404',
        'info_dict': {
            'id': '404',
            'ext': 'mp4',
            'title': 'Cascate di ghiaccio in Val Gardena',
            'description': 'md5:e8e5907f236171842674e8090e3577b8',
        },
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)

        video_key = self._html_search_regex(r'player\.peer\.tv/js/([a-zA-Z0-9]+)', webpage, 'video key')

        js = self._download_webpage(f'https://player.peer.tv/js/{video_key}/', video_id,
                                    headers={'Referer': 'https://www.peer.tv/'}, note='Downloading session id')

        session_id = self._search_regex(r'["\']session_id["\']:\s*["\']([a-zA-Z0-9]+)["\']', js, 'session id')

        player_webpage = self._download_webpage(
            f'https://player.peer.tv/jsc/{video_key}/{session_id}?jsr=aHR0cHM6Ly93d3cucGVlci50di9kZS84NDE=&cs=UTF-8&mq=2&ua=0&webm=p&mp4=p&hls=1',
            video_id, note='Downloading player webpage')