簡體   English   中英

如何解決 instascrape 標頭中的“json.decoder.JSONDecodeError:期望用雙引號括起來的屬性名稱”?

[英]How to resolve "json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes" in headers for instascrape?

我是 python 的 instascrape 庫的新手。 我正在嘗試編寫代碼來下載給定的卷軸。

from instascrape import Reel

SESSIONID = '2248906093%3A3FYd2HBRoyhW48%3A15%3AAYcqicDd5En5SuwzN0AUc5U29PJVp7V0zsQLQ80fxQ'

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.74 Safari/537.36 Edg/79.0.309.43",
"cookie":f'sessionid={SESSIONID};'
}

insta_reel = Reel(
    'https://www.instagram.com/reel/BiFaD8loJlJ/')

insta_reel.scrape(headers=headers)

insta_reel.download(fp=f".\\Pictures\\reel.mp4")

print('Downloaded Successfully.')

我收到錯誤:

 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1776.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

你能指導我嗎?

一個月前在instascrape Github repo 中描述了該錯誤,作者尚未回答。

詳細信息: https://github.com/chris-greening/instascrape/issues/164

PS IMO,回購似乎被遺棄了,最后一次提交已經將近一年了。 也許您應該自己修復錯誤,或者尋找其他工具。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM