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

Doesn't run in python 2.6.2: TypeError: NamedTemporaryFile() keywords must be strings #5539

Closed
artsemionov opened this issue Apr 27, 2015 · 3 comments

Comments

@artsemionov
Copy link

@artsemionov artsemionov commented Apr 27, 2015

Hi!
I'm using sl4a python version 2.6.2 for Android. I need to get links to videos and everything is working fine except caching. If I add --cache-dir parameter with my local folder (have write access) I get:
WARNING: Writing cache to u'/data/data/com.example.test/cache/ytdl/youtube-sigfuncs/js_en_US-vflkH_4LI_43.42.json' failed: Traceback (most recent call last):
File "/data/data/com.example.test/files/ytdl/youtube_dl/cache.py", line 50, in store
write_json_file(data, fn)
File "/data/data/com.example.test/files/ytdl/youtube_dl/utils.py", line 117, in write_json_file
tf = tempfile.NamedTemporaryFile(**args)
TypeError: NamedTemporaryFile() keywords must be strings

It seems it's relating to this issue, that was not fixed properly:
#3813

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 27, 2015

Post the full output you get when running with --verbose option.

@artsemionov
Copy link
Author

@artsemionov artsemionov commented Apr 27, 2015

I run:
python /data/data/com.example.test/files/ytdl Ek0SgwWmF9w --all-formats --get-format --cache-dir /data/data/com.example.test/cache/ytdl --verbose

I get:
nondash-171 - audio only (DASH audio)
nondash-140 - audio only (DASH audio)
nondash-160 - 144p (DASH video)
nondash-242 - 240p (DASH video)
nondash-133 - 240p (DASH video)
nondash-243 - 360p (DASH video)
nondash-134 - 360p (DASH video)
nondash-244 - 480p (DASH video)
nondash-135 - 480p (DASH video)
nondash-247 - 720p (DASH video)
nondash-136 - 720p (DASH video)
nondash-248 - 1080p (DASH video)
nondash-137 - 1080p (DASH video)
140 - audio only (DASH audio)
171 - audio only (DASH audio)
141 - audio only (DASH audio)
278 - 256x144 (DASH video)
160 - 256x144 (DASH video)
242 - 426x240 (DASH video)
133 - 426x240 (DASH video)
243 - 640x360 (DASH video)
134 - 640x360 (DASH video)
244 - 854x480 (DASH video)
135 - 854x480 (DASH video)
247 - 1280x720 (DASH video)
136 - 1280x720 (DASH video)
248 - 1920x1080 (DASH video)
137 - 1920x1080 (DASH video)
17 - 176x144
36 - 320x240
5 - 400x240
43 - 640x360
18 - 640x360
22 - 1280x720
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'Ek0SgwWmF9w', u'--all-formats', u'--get-format', u'--cache-dir', u'/data/data/com.example.test/cache/ytdl', u'--verbose']
[debug] Encodings: locale None, fs None, out None, pref UTF-8
[debug] youtube-dl version 2015.04.26
[debug] Python version 2.6.2 - Linux-3.4.10Nagging_wife_v5_BSC-armv7l-with-libc
[debug] exe versions: none
[debug] Proxy map: {}
WARNING: Writing cache to u'/data/data/com.example.test/cache/ytdl/youtube-sigfuncs/js_en_US-vflkH_4LI_43.42.json' failed: Traceback (most recent call last):
File "/data/data/com.example.test/files/ytdl/youtube_dl/cache.py", line 50, in store
write_json_file(data, fn)
File "/data/data/com.example.test/files/ytdl/youtube_dl/utils.py", line 117, in write_json_file
tf = tempfile.NamedTemporaryFile(**args)
TypeError: NamedTemporaryFile() keywords must be strings

@dstftw dstftw closed this in c86b614 Apr 27, 2015
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 27, 2015

Will be fixed in the next version. Thanks for the report.

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
2 participants
You can’t perform that action at this time.