diff --git a/gallery_dl/extractor/sexcom.py b/gallery_dl/extractor/sexcom.py index 47f5489e..f49c0b79 100644 --- a/gallery_dl/extractor/sexcom.py +++ b/gallery_dl/extractor/sexcom.py @@ -58,7 +58,9 @@ class SexcomExtractor(Extractor): if "/pin/" in response.url: return self._parse_pin_legacy(response) - return self._parse_pin_new(response) + if "/videos/" in response.url: + return self._parse_pin_video(response) + return self._parse_pin_gifs(response) def _parse_pin_legacy(self, response): extr = text.extract_from(response.text) @@ -109,8 +111,9 @@ class SexcomExtractor(Extractor): return data - def _parse_pin_new(self, response): + def _parse_pin_gifs(self, response): extr = text.extract_from(response.text) + data = { "_http_headers": {"Referer": response.url}, "type": "gif", @@ -123,12 +126,34 @@ class SexcomExtractor(Extractor): return text.nameext_from_url(data["url"], data) + def _parse_pin_video(self, response): + extr = text.extract_from(response.text) + + if not self.cookies.get("CloudFront-Key-Pair-Id", domain=".sex.com"): + self.log.warning("CloudFront cookies required for video downloads") + + data = { + "_ytdl_manifest": "hls", + "extension": "mp4", + "type": "video", + "title": text.unescape(extr("