Skip to content

Commit

Permalink
[jwplatform] Add support for bypass geo restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Jun 5, 2020
1 parent 0b1eaec commit b778882
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions youtube_dl/extractor/jwplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re

from .common import InfoExtractor
from ..utils import unsmuggle_url


class JWPlatformIE(InfoExtractor):
Expand Down Expand Up @@ -36,6 +37,10 @@ def _extract_urls(webpage):
webpage)

def _real_extract(self, url):
url, smuggled_data = unsmuggle_url(url, {})
self._initialize_geo_bypass({
'countries': smuggled_data.get('geo_countries'),
})
video_id = self._match_id(url)
json_data = self._download_json('https://cdn.jwplayer.com/v2/media/' + video_id, video_id)
return self._parse_jwplayer_data(json_data, video_id)

0 comments on commit b778882

Please sign in to comment.