diff options
author | Barbara Miller <[email protected]> | 2019-07-22 14:09:21 -0700 |
---|---|---|
committer | Sergey M․ <[email protected]> | 2019-09-01 01:25:48 +0700 |
commit | d78657fd18ae6413239137298eee4c54f3efee32 (patch) | |
tree | 6104848dc8593c551397f60d3713c9959f58603c | |
parent | cc73d5ad15aed96f6462b8079ccb6716c2ef9f85 (diff) | |
download | youtube-dl-d78657fd18ae6413239137298eee4c54f3efee32.tar.gz youtube-dl-d78657fd18ae6413239137298eee4c54f3efee32.zip |
[extractor/generic] Add support for squarespace embeds (closes #21294)
-rw-r--r-- | youtube_dl/extractor/generic.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index d34fc4b15..7dd2e2d5f 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -2076,6 +2076,17 @@ class GenericIE(InfoExtractor): 'playlist_count': 6, }, { + # Squarespace video embed, 2019-08-28 + 'url': 'http://ootboxford.com', + 'info_dict': { + 'id': 'Tc7b_JGdZfw', + 'title': 'Out of the Blue, at Childish Things 10', + }, + 'params': { + 'skip_download': True, + }, + }, + { # Zype embed 'url': 'https://www.cookscountry.com/episode/554-smoky-barbecue-favorites', 'info_dict': { @@ -2395,6 +2406,13 @@ class GenericIE(InfoExtractor): # Unescaping the whole page allows to handle those cases in a generic way webpage = compat_urllib_parse_unquote(webpage) + # unescape re.sub replacement + def unescape_resub(m): + return unescapeHTML(m.group(0)) + + # unescape squarespace video embeds + webpage = re.sub(r'<div[^>]+class=[^>]*?sqs-video-wrapper[^>]*>', unescape_resub, webpage) + # it's tempting to parse this further, but you would # have to take into account all the variations like # Video Title - Site Name |