Using Python to obtain a video address is as simple as

Cold Moon Palace leader 2021-11-25 14:24:02
using python obtain video address

The code given in the above article has a little problem , But it's a message that changed the result returned in , The obtained data content is wrong , Maybe the return results of different videos are different , I'm trying to get “3 month 23 Japan 《 How to cultivate children's learning habits and learning methods 》 Thematic education ” In the video , The following code is changed , The corresponding... Can be obtained normally URL.


import requests
import json
import re
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0'}
def qq_video(url):
appver = ''
vid = url.split('/')[-1].split('.')[0]
vid = url
print("vid:" + vid)
url = '' + appver + '&defn=fhd&vid=' + vid
html = requests.get(url, headers=headers)
html_text = html.text
print("html.text:" + html.text)
jsonstr = re.findall('QZOutputJson=(.+);$', html_text, re.S)[0]
print("jsonstr:" + jsonstr)
json_data = json.loads(jsonstr)
fvkey = json_data['vl']['vi'][0]['fvkey']
print("fvkey:" + fvkey)
# keyid = json_data['vl']['vi'][0]['cl']['keyid'].split(".")
# print("keyid:"+keyid)
# filename = keyid[0] + ".p" + keyid[1][2:] + "." + keyid[2] + ".mp4"
filename = json_data['vl']['vi'][0]['fn']
print("filename:" + filename)
cdn = json_data['vl']['vi'][0]['ul']['ui'][3]['url']
print("cdn:" + cdn)
downloadurl = cdn + filename + "?vkey=" + fvkey + "?type=mp4"
print("DownloadUrl:" + downloadurl)
## path = "E:\\Temp\\"+filename
## r = requests.get(url)
## print("ok")
## with open(path, "wb") as f:
## f.write(r.content)
## f.close()
if __name__ == "__main__":
# url = input("Put:")
url = ""


本文为[Cold Moon Palace leader]所创,转载请带上原文链接,感谢

  1. Python爬虫编程思想(85):在Python中使用非关系型数据库
  2. Volume de réglage audio Python (avec Code) | outils Python
  3. Python crawler programming idea (59): get attribute value and text with beautiful soup CSS selector
  4. Python crawler programming idea (57): basic usage of CSS selector in beautiful soup
  5. Python crawler programming idea (55): find of beautiful soup method selector_ All method
  6. Python crawler programming idea (54): use beautiful soup to select sibling nodes
  7. Python crawler programming idea (53): use beautiful soup to select the parent node
  8. Django3.0 solves the problem of error reporting in reverse parsing
  9. Precautions for Python crawler
  10. Python 3 crawler series (1) -- climbing blind date websites
  11. Python到底是什么?为什么要学Python?
  12. #yyds干货盘点#Pandas数据清洗实用指南
  13. Python打包exe文件无法运行
  14. Two common ways to save files in Python
  15. #yyds幹貨盤點#Pandas數據清洗實用指南
  16. Yyds Dry Inventory pandas Data Cleaning Practical Guide
  17. PYTHON用LSTM长短期记忆神经网络的参数优化方法预测时间序列洗发水销售数据
  18. Python集成学习:自己编写构建AdaBoost分类模型可视化决策边界及sklearn包调用比较
  19. Python 3 makes a search software
  20. Python 3 simulated microblog login
  21. Using Python 3 to make practical software for drawing modification
  22. About HTML (acceptable to Python)
  23. Python集成學習:自己編寫構建AdaBoost分類模型可視化决策邊界及sklearn包調用比較
  24. PYTHON用LSTM長短期記憶神經網絡的參數優化方法預測時間序列洗發水銷售數據
  25. Python Integrated Learning: Writing and Constructing adaboost Classification Model Visualized decision Boundary and sklearn package Calling Comparison
  26. Python prédit les données de vente de shampooing de séries chronologiques en utilisant la méthode d'optimisation des paramètres du réseau neuronal de mémoire à court et à long terme lstm
  27. [zero basics of Python to introduction] a prerequisite for Python preparatory knowledge -- basic coding specification of Python
  28. OpenCV对比度亮度变换竟能用来去水印(附Python/C++源码)
  29. [zero basics of Python to getting started] a prerequisite for Python preparatory knowledge -- installing the visualization tool pycharm
  30. The test modifies in micro python
  31. Microphoton experimental circuit board based on mm32f3273 - does not work normally
  32. Run micropathon on mm32f3273 to test performance
  33. Design mm32f3277 micro Python experimental board with SD card
  34. Mm32f3277 corresponding interface files during microphoton migration
  35. Mm32f3277 microphoton experimental board design and software testing
  36. Making and testing mm32f3277 microphoton minimum circuit board
  37. Download mm32-link program automatically with Python simulated mouse
  38. A curriculum of "artificial intelligence Python machine learning and deep learning"
  39. Test the basic functions of mm32 microphoton test circuit board
  40. Test the basic functions of the mm32f3277 micro Python development board flying one by one
  41. Debugging mm32f3277 from zhufei, transplanted with micro Python development board
  42. Recognizing numbers using OpenCV and python
  43. 真的太香了,Python速查表终于出中文版了
  44. Django REST Framework(DRF)教程:快速入门
  45. python django objects filter过滤查询:startswith year
  46. Data encapsulation of Excel test cases in Python
  47. 学员管理系统python
  48. 肝了一夜,8000字概括精髓,pandas必知必会50例!
  49. Python竟然可以画漫画!漫画版的故宫导游图,来袭!
  50. Networkx graph theory Dijkstra algorithm shortest path implementation, Python
  51. Draw a HelloWorld with Python turtle Library
  52. 运行django的服务器内存使用偶尔跳高一点,重启服务马上下来,是内存泄露吧
  53. Basic usage of Python tqdm module in machine learning training
  54. Python -- basic usage method and basic template of argparse module
  55. python-sockertserver并发编程思想
  56. Programmation simultanée du serveur de sockets Python
  57. Vue+Django 旅游网项目 首页前端实现
  58. Classic usage of pandas: iloc and LOC of data filtering
  59. Calendar module of Python time series
  60. A super easy to use Python standard library. It's great to operate directories and files