哔哩哔哩弹幕爬虫脚本

import os
import requests
from bs4 import BeautifulSoup
from pyquery import PyQuery
import re
import shutil

headers = {
    "Cookie": "CURRENT_FNVAL=16; stardustvideo=1; _uuid=3C5905C8-410F-D211-2688-E6DB4BC3D97666261infoc; "
              "LIVE_BUVID=AUTO7615735489629889; buvid3=C644BBC1-927F-4A44-B550-22D5C89A4E76155809infoc; "
              "msource=ad_bw_cpt80003; deviceFingerprint=d87f1972fefedc181aeb4fef8b35cb71; sid=60f495kc;"
              " rpdid=|(m)m)u|lJR0J'ul~JlRm|Y|; stardustpgcv=0606",
    "Host": "search.bilibili.com",
    "Referer": "https://search.bilibili.com/",
    "Sec-Fetch-Mode": "no-cors",
    "Sec-Fetch-Site": "same-site",
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)"
                  " Chrome/78.0.3904.70 Safari/537.36"}
api_headers = {
    "Cookie": "CURRENT_FNVAL=16; stardustvideo=1; _uuid=3C5905C8-410F-D211-2688-E6DB4BC3D97666261infoc;"
              " LIVE_BUVID=AUTO7615735489629889; buvid3

你可能感兴趣的:(python文本爬虫)