-import json
import hashlib
+import json
-from .aws import AWSIE
from .anvato import AnvatoIE
+from .aws import AWSIE
from .common import InfoExtractor
from ..utils import (
smuggle_url,
'skip_download': True,
},
'add_ie': [AnvatoIE.ie_key()],
+ 'skip': '404 Not Found',
}]
_SNI_TABLE = {
site_id, video_id = mobj.group('site', 'id')
aws_identity_id_json = json.dumps({
- 'IdentityId': '%s:7655847c-0ae7-4d9b-80d6-56c062927eb3' % self._AWS_REGION
- }).encode('utf-8')
+ 'IdentityId': f'{self._AWS_REGION}:7655847c-0ae7-4d9b-80d6-56c062927eb3',
+ }).encode()
token = self._download_json(
- 'https://cognito-identity.%s.amazonaws.com/' % self._AWS_REGION, video_id,
+ f'https://cognito-identity.{self._AWS_REGION}.amazonaws.com/', video_id,
data=aws_identity_id_json,
headers={
'Accept': '*/*',
def get(key):
return xpath_text(
- sts, './/{https://sts.amazonaws.com/doc/2011-06-15/}%s' % key,
+ sts, f'.//{{https://sts.amazonaws.com/doc/2011-06-15/}}{key}',
fatal=True)
mcp_id = self._aws_execute_api({
- 'uri': '/1/web/brands/%s/episodes/scrid/%s' % (self._SNI_TABLE[site_id], video_id),
+ 'uri': f'/1/web/brands/{self._SNI_TABLE[site_id]}/episodes/scrid/{video_id}',
'access_key': get('AccessKeyId'),
'secret_key': get('SecretAccessKey'),
'session_token': get('SessionToken'),
return self.url_result(
smuggle_url(
- 'anvato:anvato_scripps_app_web_prod_0837996dbe373629133857ae9eb72e740424d80a:%s' % mcp_id,
+ f'anvato:anvato_scripps_app_web_prod_0837996dbe373629133857ae9eb72e740424d80a:{mcp_id}',
{'geo_countries': ['US']}),
AnvatoIE.ie_key(), video_id=mcp_id)
'timestamp': 1475678834,
'upload_date': '20161005',
'uploader': 'SCNI-SCND',
+ 'tags': 'count:10',
+ 'creator': 'Cooking Channel',
+ 'duration': 29.995,
+ 'chapters': [{'start_time': 0.0, 'end_time': 29.995, 'title': '<Untitled Chapter 1>'}],
+ 'thumbnail': 'https://images.dds.discovery.com/up/tp/Scripps_-_Food_Category_Prod/122/987/0260338_630x355.jpg',
},
'add_ie': ['ThePlatform'],
'expected_warnings': ['No HLS formats found'],