diff --git a/qushuiyin.py b/qushuiyin.py index 8181896..f8d1ed1 100644 --- a/qushuiyin.py +++ b/qushuiyin.py @@ -251,6 +251,32 @@ class Video: response = requests.post(url, headers=headers, data=post_data) json_data = response.json() + if len(json_data["photo"]["mainMvUrls"]) == 0: + cdn = json_data["photo"]["ext_params"]["atlas"]["cdn"][0] + origin_image_urls = [ + ("https://" + cdn + image) + for image in json_data["photo"]["ext_params"]["atlas"]["list"] + ] + image_urls = [endecode_and_proxy_url(url) for url in origin_image_urls] + + result = { + "code": 200, + "msg": "解析成功", + "data": { + "avatar": endecode_and_proxy_url(json_data["photo"]["headUrl"]), + "author": json_data["photo"]["userName"], + "time": json_data["photo"]["timestamp"], + "title": json_data["photo"]["caption"], + "cover": endecode_and_proxy_url( + json_data["photo"]["coverUrls"][0]["url"] + ), + "origin_cover": json_data["photo"]["coverUrls"][0]["url"], + "image_urls": image_urls, + "origin_image_urls": origin_image_urls, + }, + } + return result + video_url = json_data["photo"]["mainMvUrls"][0]["url"] if video_url: result = {