Closed wlerin closed 6 years ago
Can you provide an example? Regardless, this is a messy extraction and we should ignore parameters that are not present. One possibility is chaining get()
, like params.get("video", {}).get("owner", {}).get("id")
.
rstrip()
will make nickname extraction safer.
On at least one video, the script is throwing an error when trying to get uploader and uploader_id here:
It appears that the video has no "owner".
I've modified the script so that section reads:
Which seems to solve the issue. Not sure if this can occur in videoDetail (why is that not mutually exclusive with video?)
Also, that strip() is potentially destructive if the nickname has さ or ん at the beginning or end of their real nickname.