From a6f8feef491dc4b0af0082b16788a1e28ef9c61a Mon Sep 17 00:00:00 2001 From: Ben Welsh Date: Mon, 8 Aug 2022 09:45:59 -0700 Subject: [PATCH 1/4] Update youtube_dl/extractor/parler.py Co-authored-by: dirkf --- youtube_dl/extractor/parler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/parler.py b/youtube_dl/extractor/parler.py index e56607981..ecc44216c 100644 --- a/youtube_dl/extractor/parler.py +++ b/youtube_dl/extractor/parler.py @@ -5,7 +5,12 @@ from urllib import parse from .common import InfoExtractor -from ..utils import clean_html, unified_timestamp +from ..utils import ( + clean_html, + strip_or_none, + unified_timestamp, + urlencode_postdata, +) class ParlerIE(InfoExtractor): From b1bbb03e0b8f026e78748f6bfd822691522ddf13 Mon Sep 17 00:00:00 2001 From: Ben Welsh Date: Mon, 8 Aug 2022 09:46:26 -0700 Subject: [PATCH 2/4] Update youtube_dl/extractor/parler.py Co-authored-by: dirkf --- youtube_dl/extractor/parler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/parler.py b/youtube_dl/extractor/parler.py index ecc44216c..0b09c1955 100644 --- a/youtube_dl/extractor/parler.py +++ b/youtube_dl/extractor/parler.py @@ -16,7 +16,8 @@ from ..utils import ( class ParlerIE(InfoExtractor): """Extract videos from posts on Parler.""" - _VALID_URL = r"https://parler\.com/feed/(?P[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})" + _UUID_RE = r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' + _VALID_URL = r'https://parler\.com/feed/(?P%s)' % (_UUID_RE, ) _TESTS = [ { "url": "https://parler.com/feed/df79fdba-07cc-48fe-b085-3293897520d7", From 1a82825b9c4ce8b88b3c5cf36742bbaba91e68ae Mon Sep 17 00:00:00 2001 From: Ben Welsh Date: Mon, 8 Aug 2022 09:46:46 -0700 Subject: [PATCH 3/4] Update youtube_dl/extractor/parler.py Co-authored-by: dirkf --- youtube_dl/extractor/parler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/parler.py b/youtube_dl/extractor/parler.py index 0b09c1955..ab7ddf319 100644 --- a/youtube_dl/extractor/parler.py +++ b/youtube_dl/extractor/parler.py @@ -51,7 +51,7 @@ class ParlerIE(InfoExtractor): video_id = self._match_id(url) # Get data from API - api_url = "https://parler.com/open-api/ParleyDetailEndpoint.php" + api_url = 'https://parler.com/open-api/ParleyDetailEndpoint.php' payload = parse.urlencode({"uuid": video_id}).encode() status = self._download_json(api_url, video_id, data=payload) From ff952d586b3302d706cbdc14de8c17f75990397d Mon Sep 17 00:00:00 2001 From: Ben Welsh Date: Mon, 8 Aug 2022 09:47:08 -0700 Subject: [PATCH 4/4] Update youtube_dl/extractor/parler.py Co-authored-by: dirkf --- youtube_dl/extractor/parler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/parler.py b/youtube_dl/extractor/parler.py index ab7ddf319..b3cd3ab85 100644 --- a/youtube_dl/extractor/parler.py +++ b/youtube_dl/extractor/parler.py @@ -56,9 +56,9 @@ class ParlerIE(InfoExtractor): status = self._download_json(api_url, video_id, data=payload) # Pull out video - data = status["data"][0]["primary"] - video = data["video_data"] - url = video["videoSrc"] + url = status['data'][0]['primary']['video_data']['videoSrc'] + # now we know this exists and is a dict + data = status['data'][0]['primary'] # Pull out metadata title = clean_html(data.get("full_body")).replace("\n", "")