Skip to content

Commit

Permalink
Merge branch 'rachel-cnbc' into cnbc
Browse files Browse the repository at this point in the history
  • Loading branch information
J. Gonzalez committed Dec 9, 2023
2 parents b272679 + b5260a1 commit 72e9d82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yt_dlp/extractor/cnbc.py
Expand Up @@ -2,7 +2,7 @@
import json
import re
from datetime import datetime
from ..utils import clean_html, traverse_obj, unified_timestamp, variadic
from ..utils import clean_html, traverse_obj, unified_timestamp, unified_strdate, variadic


class CNBCIE(InfoExtractor):
Expand All @@ -19,7 +19,6 @@ class CNBCIE(InfoExtractor):
"uploader": "NBCU-CNBC",
},
"params": {
# m3u8 download
"skip_download": True,
},
"skip": "Dead link",
Expand Down Expand Up @@ -78,15 +77,16 @@ def _real_extract(self, url):
)
)
url = metadata["page"]["page"]["layout"][1]["columns"][0]["modules"][0]["data"]["encodings"][0]["url"]
duration = metadata['page']['page']['layout'][1]['columns'][1]['modules'][0]['data']['duration']

# import pdb
# pdb.set_trace()
return {
"id": str(video_id),
"url": metadata["page"]["page"]["layout"][1]["columns"][0]["modules"][0][
"data"
]["encodings"][0]["url"],
"formats": self._extract_akamai_formats(url, str(video_id)),
"channel": self._html_search_regex(r'<div class="ClipPlayer-clipPlayerIntroSection"><[^>]*>([^<]+)<', webpage, 'channel name'),
"upload_date": unified_strdate(metadata['page']['page']['layout'][1]['columns'][0]['modules'][0]['data']['uploadDate']),
**traverse_obj(
self._search_json_ld(webpage, str(video_id), default={}),
{
Expand Down

0 comments on commit 72e9d82

Please sign in to comment.