Skip to content

Commit

Permalink
rednote: ensure video has media else missing
Browse files Browse the repository at this point in the history
  • Loading branch information
dale-wahl committed Feb 19, 2025
1 parent 08b8480 commit cb74df6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasources/xiaohongshu/search_rednote.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def map_item_from_json_api_explore(post):

# permalinks need this token to work, else you get a 404 not found
xsec_bit = f"?xsec_token={post['xsec_token']}" if post.get("xsec_token") else ""
if item.get("video"):
if item.get("video", {}).get("media"):
video_url = item["video"]["media"]["stream"]["h264"][0]["master_url"]
else:
video_url = MissingMappedField("")
Expand Down

0 comments on commit cb74df6

Please sign in to comment.