Skip to content

Commit

Permalink
format upload_date
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijinwuu committed Dec 9, 2023
1 parent c164f09 commit b5260a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions yt_dlp/extractor/cnbc.py
Expand Up @@ -2,6 +2,8 @@
from ..utils import smuggle_url, clean_html
import json
import re
from ..utils import (
unified_strdate)


class CNBCIE(InfoExtractor):
Expand Down Expand Up @@ -78,13 +80,13 @@ def _real_extract(self, url):
raise ValueError("JSON data not found")
metadata = json.loads(matched.group(1))
url = metadata["page"]["page"]["layout"][1]["columns"][0]["modules"][0]["data"]["encodings"][0]["url"]
upload_date = metadata['page']['page']['layout'][1]['columns'][0]['modules'][0]['data']['uploadDate']
upload_date = unified_strdate(metadata['page']['page']['layout'][1]['columns'][0]['modules'][0]['data']['uploadDate'])
# whether the video is restricted or not
video_status = metadata['page']['page']['layout'][1]['columns'][0]['modules'][0]['data']['videoStatus']
author = metadata['page']['page']['layout'][1]['columns'][0]['modules'][0]['data']['authorFormattedFull']

#import pdb
#pdb.set_trace()
import pdb
pdb.set_trace()

return_data = {
"id": video_id,
Expand Down

0 comments on commit b5260a1

Please sign in to comment.