接收到contentencoding:gzip的响应,但未能解码i

2024-05-18 09:08:41 发布

您现在位置:Python中文网/ 问答频道 /正文

向发出GET请求时

https://apicache.vudu.com/api2/?_type=contentSearch&contentEncoding=gzip&contentId={}&dimensionality=any&followup=ultraVioletability&followup=longCredits&followup=superType&followup=episodeNumberInSeason&followup=advertContentDefinitions&followup=tag&followup=hasBonusWithTagExtras&followup=subtitleTrack&followup=ratingsSummaries&followup=geneGenres&followup=seasonNumber&followup=trailerEditionId&followup=genres&followup=usefulStreamableOffers&followup=walmartOffers&followup=preOrderOffers&followup=editions&followup=merchandiseContentMaps&followup=promoTags&followup=advertEnabled&format=application%2Fjson

来自AWS的我间歇性地收到以下错误:

^{pr2}$

示例:

requests.get(url.format('832504'))
<Response [200]>
requests.get(url.format('460398'))
<Response [200]>
requests.get(url.format('27616'))
<Response [200]>
requests.get(url.format('23657'))
<Response [200]>
requests.get(url.format('8661'))
ContentDecodingError...
requests.get(url.format('14250'))
<Response [200]>
requests.get(url.format('516307'))
ContentDecodingError...
requests.get(url.format('10366'))
<Response [200]>

我尝试了不同的头组合(包括这里的建议:https://github.com/requests/requests/issues/3849)和删除{}参数(返回502个状态代码)。在

考虑到这个API在我的电脑上完美地工作,也许Vudu和AWS之间存在一些冲突?在


Tags: httpscomawsformaturlgetresponsetype