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

[Playvids] Add new extractor #26798

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/supportedsites.md
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@
- **PlaysTV**
- **Playtvak**: Playtvak.cz, iDNES.cz and Lidovky.cz
- **Playvid**
- **Playvids**
dirkf marked this conversation as resolved.
Show resolved Hide resolved
- **Playwire**
- **pluralsight**
- **pluralsight:course**
Expand Down
1 change: 1 addition & 0 deletions youtube_dl/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@
from .plays import PlaysTVIE
from .playtvak import PlaytvakIE
from .playvid import PlayvidIE
from .playvids import PlayvidsIE
from .playwire import PlaywireIE
from .pluralsight import (
PluralsightIE,
Expand Down
50 changes: 50 additions & 0 deletions youtube_dl/extractor/playvids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# coding: utf-8
from __future__ import unicode_literals

import re

from .common import InfoExtractor
from ..utils import ExtractorError


class PlayvidsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?playvids\.com/(?P<id>.+?)/(?P<seo>.+?)(?:$|[#\?])'
_TEST = {
'url': 'https://www.playvids.com/bKmGLe3IwjZ/sv/brazzers-800-phone-sex-madison-ivy-always-on-the-line',
'md5': '3b57615c81d5580919d3a0b216056a15',
'info_dict': {
'id': 'bKmGLe3IwjZ',
'ext': 'mp4',
'title': 'Brazzers - 1 800 Phone Sex: Madison Ivy Always On The Line 6',
'age_limit': 18,
}
}

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').strip()

# search for the video urls
video_tags = re.findall(r'data-hls-src[0-9]*?="https:\/\/.*?userscontent.net.*?\.mp4\/index.m3u8\?seclink=.*?sectime=[0-9]*"', webpage)

# get the url from each match
video_urls = []
for n in video_tags:
video_urls.append(self._html_search_regex(r'"(.*?)"', n, 'url').replace("&amp;", "&"))

# reverse list so the best format is first
video_urls.reverse()

# check if nothing was found before attempting anything
if len(video_urls) == 0:
raise ExtractorError('No video URLs found')
else:
return {
'id': video_id,
'title': title,
'url': video_urls[0],
'ext': 'mp4',
'age_limit': 18,
}