- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 youtube-dl 库 ( https://rg3.github.io/youtube-dl/ ) 有问题。我使用 youtube-dl 不是通过这个库直接下载视频,而是我首先使用这样的命令生成链接:youtube-dl --simulate --dump-json --prefer-ffmpeg -- -CmadmM5cOk
我从 json 答案中获得了所需的格式链接,我使用默认格式 1280x720 mp4。链接看起来像这样“https://r4---sn-nto52nx-px8e.googlevideo.com/videoplayback?lmt=1432339993780507&ip=x.x.x.x&key=yt6&fexp=9408710%2C9409069%2C9413137%2C9415365%2C9415485%2C9416023%2C9416126%2C941 ...”。
然后我使用此链接从不同位置的不同 PC 下载视频。对于大多数链接,它可以正常工作,但也有一些视频,例如 https://www.youtube.com/watch?v=-CmadmM5cOk ,我无法从不同的服务器或 PC 下载,它返回 ERROR 403: Forbidden。
所以到目前为止我尝试过的,我有 2 台服务器和我的本地 PC,所有 3 台都位于不同的国家/地区,美国、英国和乌克兰。
例如,我在美国的服务器 1 上运行 youtube-dl 并获取链接,我得到链接,我可以在此服务器 1 中下载它,但是在伦敦的服务器 2 和我在乌克兰的本地 PC 上,它返回 ERROR 403: Forbidden。
另一个例子,我在伦敦的服务器 2 上生成链接,我得到不同的链接,我可以在同一台服务器上下载它,但是当我在服务器 1 或我的本地 PC 上尝试时,我得到相同的 ERROR 403: Forbidden。当我在本地 PC 上生成链接并在服务器上尝试时也是如此。
这只发生在一些精确的视频中,但有很多。一些返回 403 的视频:https://www.youtube.com/watch?v=09R8_2nJtjg , https://www.youtube.com/watch?v=7PCkvCPvDXk .
谢谢,我很感激任何帮助!
更新:
我正在尝试使用您建议的选项“-o -”将视频文件输出到标准输出,然后将其重新翻译给用户。但是我有另一个问题,如果我使用 ssh 登录并使用我的用户尝试命令它可以工作,但是当我在“www-data”用户下启动相同的命令时它会抛出 403 错误。这是详细的输出:
这是详细报告:
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--prefer-ffmpeg', u'--no-warnings', u'-f', u'22', u'-o', u'-', u'-v', u'--', u'QcIy9NiNbmo']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.08.16.1
[debug] Python version 2.7.3 - Linux-4.1.0-x86_64-linode59-x86_64-with-debian-7.8
[debug] exe versions: avconv 0.8.17-6, avprobe 0.8.17-6, ffmpeg 0.8.17-6, ffprobe 0.8.17-6
[debug] Proxy map: {}
[youtube] QcIy9NiNbmo: Downloading webpage
[youtube] QcIy9NiNbmo: Downloading video info webpage
[youtube] QcIy9NiNbmo: Extracting video information
[youtube] {22} signature length 40.42, html5 player new
[youtube] {43} signature length 40.42, html5 player new
[youtube] {18} signature length 40.42, html5 player new
[youtube] {5} signature length 40.42, html5 player new
[youtube] {36} signature length 40.42, html5 player new
[youtube] {17} signature length 40.42, html5 player new
[youtube] {137} signature length 40.42, html5 player new
[youtube] {248} signature length 40.42, html5 player new
[youtube] {136} signature length 40.42, html5 player new
[youtube] {247} signature length 40.42, html5 player new
[youtube] {135} signature length 40.42, html5 player new
[youtube] {244} signature length 40.42, html5 player new
[youtube] {134} signature length 40.42, html5 player new
[youtube] {243} signature length 40.42, html5 player new
[youtube] {133} signature length 40.42, html5 player new
[youtube] {242} signature length 40.42, html5 player new
[youtube] {160} signature length 40.42, html5 player new
[youtube] {140} signature length 40.42, html5 player new
[youtube] {171} signature length 40.42, html5 player new
[youtube] QcIy9NiNbmo: Downloading DASH manifest
[debug] Invoking downloader on u'https://r6---sn-q4f7sn7s.googlevideo.com/videoplayback?dur=244.924&ipbits=0&sver=3&expire=1440076742&itag=22&lmt=1432153223392108&ratebypass=yes&fexp=9406010%2C9407118%2C9407156%2C9408710%2C9409069%2C9412515%2C9412774%2C9412779%2C9415365%2C9415485%2C9416023%2C9416126%2C9416326%2C9416916%2C9417707%2C9418153%2C9418449%2C9418954&key=yt5&mime=video%2Fmp4&initcwndbps=19078750&source=youtube&upn=H3j2i1TBZjA&mn=sn-q4f7sn7s&mm=31&pl=32&id=o-ADA7nHOi-VHvDpG35GbK7zvbnjmrppbPKN4PlVS25gcx&requiressl=yes&pcm2=no&ip=2600%3A3c00%3A%3Af03c%3A91ff%3Afe84%3A4cc7&mv=m&sparams=dur%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&mt=1440055050&ms=au&signature=FCB04C87410298BCDA619B8DB06221417292500B.669E8F187A5885C08D057F924A9551A657FF584B'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1585, in process_info
success = dl(filename, info_dict)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1527, in dl
return fd.download(name, info)
File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 342, in download
return self.real_download(filename, info_dict)
File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 60, in real_download
data = self.ydl.urlopen(request)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1860, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 407, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 445, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
最佳答案
最终下载 URL 只能保证在提取的同一台机器/IP 上工作。 More on this .
更新:
要摆脱 403,请运行 youtube-dl --rm-cache-dir
删除缓存代www-data
.
关于video - Youtube-dl 库和错误 403 : Forbidden when using generated direct link by youtube-dl from different locations,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32104702/
我一直收到这个“禁止您无权访问此服务器上的/。此外,在尝试使用 ErrorDocument 处理请求时遇到 403 禁止错误。”当尝试访问我的网站时,错误仍然存在,但没有安装 WordPress
我对Kibana创建的“新用户”有问题(使用用户“ flex ”)。这是我做的顺序。 我正在使用ELK for 7.5.1版本 首先,我通过添加elasticsearch.yml 来启用xpack.s
我只是在Elasticsearch 7.1.0中设置了xpack 如下在elasticsearch.yml中: xpack.security.enabled: true discovery.type:
我刚刚在新安装的 ES 堆栈上设置了身份验证。 我跟着: https://www.elastic.co/guide/en/elastic-stack-overview/current/get-star
我尝试在我的 Spring Boot 应用程序上配置 OpenFeign,我使用 pokeapi 进行测试。 我编写了这段代码: @FeignClient(value = "pokeapi", url
我正在使用strapi,我在调用api时收到错误403 Forbidden,例如http://localhost:1337/data 我已经调用了所有的 API,结果是相同的 403 错误 我也用 p
当我尝试将图片上传到“汽车”对象时,我被拒绝访问 S3。但是自从我添加了 S3 以来,assets 文件夹中的站点图像显示得很好。我得到的具体错误是这样的: 2015-02-17T14:40:48.4
当我尝试在管理员授权后添加新帖子时看到此响应。 我有基于 Spring Boot 安全性的基本授权: @Configuration @EnableWebSecurity public class Se
我有一个响应式(Reactive)(Spring WebFlux)Web 应用程序,其中很少有 protected 资源的 REST API。(Oauth2)。要手动访问它们,我需要获取具有客户端凭据
可以看到的错误是 client.GetKeyStats 函数返回的 403 Forbidden。 基于源代码无需认证。 源代码:https://github.com/timpalpant/go-iex
堆栈跟踪 Exception in thread "main" com.amazonaws.services.s3.model.AmazonS3Exception: Forbidden (Servic
几天前,当我尝试将文件推送到我的 S3Bucket 时收到此异常。更早的一切似乎都能正常工作,我确信我这边没有代码更改。 com.amazonaws.services.s3.model.AmazonS
当用户尝试访问他们无权访问的资源时,我的服务器会返回 403 禁止错误。除了 header 之外,服务器还会写入一条描述错误的小消息。 在 Firefox 中,错误消息显示得很好,用户知道发生了什么。
我支持一个 java 应用程序,它有一个搜索栏,可以匹配关键字并从缓存中获取结果。 该应用程序在 Tomcat 中运行,并且还有一个 Apache Web 服务器。 搜索 aaa' 时出现问题,特殊字
我正在将网站从一台托管服务器移动到另一台托管服务器。我已经上传了文件。我正在使用表单例份验证。基本上,我要搬到 GoDaddy。 我可以直接访问登录表单:www.mysite.com/login.as
我创建了一个 Azure KeyVault,我希望我的应用服务能够访问它。据我所知,我的 App Service 的主体应该有权访问 KeyVault,但在尝试从中检索时,我总是收到以下错误。无论我是
我尝试通过应用上的 URLRequest 将 multipart/form-data 发送到 Cloud Functions for Firebase。为了测试我的云函数和应用程序是否已连接,我创建了
这是后端 SiteController.php 访问规则。当我浏览此 url site.com/backend/web/site/login 时。它显示禁止 (#403)。 return [
使用 java 访问 Google PubSub、Dataflow 和 BigQuery 的 Spring boot 应用程序。该应用程序是使用 maven 构建的,并将 jar 文件复制到 Goog
我在 Kubernetes* 的仪表板站点上到处都是“被禁止”(见图) 重现: 通过站点创建 Google Kubernetes 集群,而不是通过 shell。 选择 Kubernetes 版本 1.
我是一名优秀的程序员,十分优秀!