Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 Questions using aria2c in python #20342

Closed
TA40 opened this issue Mar 14, 2019 · 2 comments
Closed

2 Questions using aria2c in python #20342

TA40 opened this issue Mar 14, 2019 · 2 comments

Comments

@TA40
Copy link

@TA40 TA40 commented Mar 14, 2019

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2019.03.09. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2019.03.09

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2019.03.09
[debug] Python version 3.6.4 (CPython) - Windows-10-10.0.17763-SP0
[debug] exe versions: ffmpeg 3.4.2
[debug] Proxy map: {}
[youtube] DLzxrzFCyOs: Downloading webpage
[youtube] DLzxrzFCyOs: Downloading video info webpage
[youtube] {18} signature length 42.41, html5 player vflkyt12p
[youtube] {271} signature length 42.41, html5 player vflkyt12p
[youtube] {137} signature length 42.41, html5 player vflkyt12p
[youtube] {248} signature length 42.41, html5 player vflkyt12p
[youtube] {136} signature length 42.41, html5 player vflkyt12p
[youtube] {247} signature length 42.41, html5 player vflkyt12p
[youtube] {135} signature length 42.41, html5 player vflkyt12p
[youtube] {244} signature length 42.41, html5 player vflkyt12p
[youtube] {134} signature length 42.41, html5 player vflkyt12p
[youtube] {243} signature length 42.41, html5 player vflkyt12p
[youtube] {133} signature length 42.41, html5 player vflkyt12p
[youtube] {242} signature length 42.41, html5 player vflkyt12p
[youtube] {160} signature length 42.41, html5 player vflkyt12p
[youtube] {278} signature length 42.41, html5 player vflkyt12p
[youtube] {140} signature length 42.41, html5 player vflkyt12p
[youtube] {171} signature length 42.41, html5 player vflkyt12p
[youtube] {249} signature length 42.41, html5 player vflkyt12p
[youtube] {250} signature length 42.41, html5 player vflkyt12p
[youtube] {251} signature length 42.41, html5 player vflkyt12p
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://r2---sn-4g5e6nsk.googlevideo.com/videoplayback?lmt=1538219388413002&dur=212.579&txp=5532432&itag=271&clen=88019015&gir=yes&fvip=2&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&requiressl=yes&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C271%2C278&mv=m&mt=1552535616&ms=au%2Conr&pl=16&keepalive=yes&id=o-AD37HiS6Wta-Q-vceNFTu7Jg5HmlTkKI876F0HtWEAj9&ipbits=0&mn=sn-4g5e6nsk%2Csn-h0jeener&mm=31%2C26&ip=176.198.183.108&initcwndbps=1548750&c=WEB&expire=1552557338&ei=udCJXO3vO8a_gQeA8bbQCA&key=yt6&mime=video%2Fwebm&signature=3B28054F94099C4551264ADCA2A5CF12EF0D5A56.05D567FFE576E7FDABD4A9213728EA89E50CB6DA&ratebypass=yes'
[download] Destination: Rick Astley - Never Gonna Give You Up [HQ]-DLzxrzFCyOs.f271.webm
Traceback (most recent call last):
  File "testen.py", line 12, in <module>
    down.download(["https://www.youtube.com/watch?v=DLzxrzFCyOs"])
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 2006, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 805, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 859, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 1640, in process_video_result
    self.process_info(new_info)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 1907, in process_info
    partial_success = dl(fname, new_info)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 1852, in dl
    return fd.download(name, info)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\downloader\common.py", line 364, in download
    return self.real_download(filename, info_dict)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\downloader\external.py", line 35, in real_download
    retval = self._call_downloader(tmpfilename, info_dict)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\downloader\external.py", line 101, in _call_downloader
    cmd = [encodeArgument(a) for a in self._make_cmd(tmpfilename, info_dict)]
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\downloader\external.py", line 187, in _make_cmd
    '--min-split-size', '1M', '--max-connection-per-server', '4'])
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\downloader\external.py", line 97, in _configuration_args
    return cli_configuration_args(self.params, 'external_downloader_args', default)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\youtube_dl\utils.py", line 2923, in cli_configuration_args
    assert isinstance(ex_args, list)
AssertionError

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):


Description of your issue, suggested solution and other information

First of all, this is the simple python code:

# -*- coding: utf-8 -*-
import os
import youtube_dl
cwd = os.getcwd()

download_opts = {
'external_downloader':"aria2c",
'external_downloader_args':"-x 16 -s 16 -k 1M",
'verbose':True,
}
with youtube_dl.YoutubeDL(download_opts) as down:
	down.download(["https://www.youtube.com/watch?v=DLzxrzFCyOs"])

So, my questions are:

  1. How do I set the path for aria2c? I don't want the aria2c.exe inside the folder where the script is, it should be in an subfolder called "bin".
    I tried 'external_downloader':"bin\\aria2c", or 'external_downloader':cwd+"\\bin\\aria2c", but either it ignored it or it gave me an error.

  2. How do I specify the external_downloader_args? It works when aria2c is in the same folder as the .py script and I delete the line 'external_downloader_args':"-x 16 -s 16 -k 1M", but with it, it just outputs the error above.

This question was asked, but you said we should open a new Issue with reproducable environment, so I attached a .zip if needed. It just contains the script, a .bat file, aria2c and an empty "bin" folder ^^ test.zip
#15337 (comment)

Thanks!

@ealgase
Copy link
Contributor

@ealgase ealgase commented Mar 14, 2019

You should put the aria2c binary in a folder in your PATH.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 14, 2019

As for 2, external_downloader_args must be a list not string as clearly stated in option's description.

@dstftw dstftw closed this Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.