Skip to content

Commit

Permalink
[extractor/generic] Add support for squarespace embeds (closes #21294)
Browse files Browse the repository at this point in the history
  • Loading branch information
galgeek authored and meunierd committed Feb 13, 2020
1 parent 80aabb6 commit 0584490
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions youtube_dl/extractor/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,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',
Expand Down Expand Up @@ -2395,6 +2406,13 @@ def _real_extract(self, url):
# 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
Expand Down

0 comments on commit 0584490

Please sign in to comment.