GetResponse.py 811 B

12345678910111213141516171819
  1. # -*- coding: utf-8 -*-
  2. # @Author : ChenZhaoyuchen
  3. # @Time : 2024/9/13 15:03
  4. # @File : GetResponse.py
  5. import requests
  6. headers_bili = {
  7. 'accept': 'text / html, application / xhtml + xml, application / xml;q = 0.9, image / avif, image / webp, image / apng, * / *;q = 0.8, application / signed - exchange;v = b3;q = 0.7',
  8. 'accept - encoding': 'gzip, deflate',
  9. 'accept - language': 'zh - CN, zh;q = 0.9, en;q = 0.8, en - GB;q = 0.7, en - US;q = 0.6',
  10. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0',
  11. 'Referer': 'https://www.bilibili.com/?spm_id_from=333.337.0.0'
  12. }
  13. def GetResponse(url):
  14. headers = headers_bili
  15. response = requests.get(url = url,headers = headers)
  16. return response