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

Code before:
    url_or_none,
)


class ManyVidsIE(InfoExtractor):
    _VALID_URL = r'(?i)https?://(?:www\.)?manyvids\.com/video/(?P<id>\d+)'
    _TESTS = [{
        # Dead preview video
        'skip': True,
        'url': 'https://www.manyvids.com/Video/133957/everthing-about-me/',
        'md5': '03f11bb21c52dd12a05be21a5c7dcc97',
        'info_dict': {
            'id': '133957',
            'ext': 'mp4',
            'title': 'everthing about me (Preview)',
            'uploader': 'ellyxxix',
            'view_count': int,
            'like_count': int,
        },
    }, {
        # preview video
        'url': 'https://www.manyvids.com/Video/530341/mv-tips-tricks',
        'md5': '738dc723f7735ee9602f7ea352a6d058',
        'info_dict': {
            'id': '530341',
            'ext': 'mp4',
            'title': 'MV Tips &amp; Tricks (Preview)',
            'description': 'md5:c3bae98c0f9453237c28b0f8795d9f83',
            'thumbnail': 'https://cdn5.manyvids.com/php_uploads/video_images/DestinyDiaz/thumbs/thumb_Hs26ATOO7fcZaI9sx3XT_screenshot_001.jpg',
            'uploader': 'DestinyDiaz',
            'view_count': int,
            'like_count': int,
            'release_timestamp': 1508419904,
            'tags': ['AdultSchool', 'BBW', 'SFW', 'TeacherFetish'],
            'release_date': '20171019',
            'duration': 3167.0,
        },
    }, {
        # full video
        'url': 'https://www.manyvids.com/Video/935718/MY-FACE-REVEAL/',
        'md5': 'bb47bab0e0802c2a60c24ef079dfe60f',
        'info_dict': {
            'id': '935718',
            'ext': 'mp4',
            'title': 'MY FACE REVEAL',
            'description': 'md5:ec5901d41808b3746fed90face161612',
            'thumbnail': 'https://ods.manyvids.com/1001061960/3aa5397f2a723ec4597e344df66ab845/screenshots/thumbs/custom_1_180_5be09c1dcce03.jpg',
            'uploader': 'Sarah Calanthe',
            'view_count': int,
            'like_count': int,
            'release_date': '20181110',

Review comment (refactor):
```suggestion
        },
        'expected_warnings': ['Only extracting preview'],
```

Code after:
    parse_iso8601,
    url_or_none,
)
from ..utils.traversal import traverse_obj


class ManyVidsIE(InfoExtractor):
    _VALID_URL = r'(?i)https?://(?:www\.)?manyvids\.com/video/(?P<id>\d+)'
    _TESTS = [{
        # preview video
        'url': 'https://www.manyvids.com/Video/530341/mv-tips-tricks',
        'md5': '738dc723f7735ee9602f7ea352a6d058',
        'info_dict': {
            'id': '530341-preview',
            'ext': 'mp4',
            'title': 'MV Tips & Tricks (Preview)',
            'description': r're:I will take you on a tour around .{1313}$',
            'thumbnail': r're:https://cdn5\.manyvids\.com/php_uploads/video_images/DestinyDiaz/.+\.jpg',
            'uploader': 'DestinyDiaz',
            'view_count': int,
            'like_count': int,
            'release_timestamp': 1508419904,
            'tags': ['AdultSchool', 'BBW', 'SFW', 'TeacherFetish'],
            'release_date': '20171019',
            'duration': 3167.0,
        },
        'expected_warnings': ['Only extracting preview'],
    }, {
        # full video
        'url': 'https://www.manyvids.com/Video/935718/MY-FACE-REVEAL/',
        'md5': 'bb47bab0e0802c2a60c24ef079dfe60f',
        'info_dict': {
            'id': '935718',
            'ext': 'mp4',
            'title': 'MY FACE REVEAL',
            'description': r're:Today is the day!! I am finally taking off my mask .{445}$',
            'thumbnail': r're:https://ods\.manyvids\.com/1001061960/3aa5397f2a723ec4597e344df66ab845/screenshots/.+\.jpg',
            'uploader': 'Sarah Calanthe',
            'view_count': int,
            'like_count': int,
            'release_date': '20181110',
            'tags': ['EyeContact', 'Interviews', 'MaskFetish', 'MouthFetish', 'Redhead'],
            'release_timestamp': 1541851200,
            'duration': 224.0,
        },
    }]
    _API_BASE = 'https://www.manyvids.com/bff/store/video'

    def _real_extract(self, url):
        video_id = self._match_id(url)
        video_data = self._download_json(f'{self._API_BASE}/{video_id}/private', video_id)['data']