Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
running youtube-dl on android (samsung galaxy s3 phone) #1654
Comments
|
What is the output of Also note that in your second approach, you should rename youtube-dl to something other than
If you want to follow up on my post with the screenshot (which used your first method, but with a current Python), please just comment there. Otherwise, it gets too confusing to track the problems over multiple issues. Additionally, people searching for android can then benefit from your experience. Thanks! |
|
Final run ok for me, this is the code that running right import sys,os Add os library to change directory if denied write permissions |
I have tried to run the youtube-dl.py script on android following the procedure described in #967 but not all the steps are indicated.
I couldn't figure out how to run the script using the direct method: "python youtube-dl.py" so I tried to create a top-level file that calls the script and it looks like it wants to run, but I get the error:
"SyntaxError: Non-ASCII character '\xeb' in file /storage/sdcard0/sl4a/scripts/youtube-dl.py on line 3, but no encoding declared"
I then added a line to define the encoding as utf-8 in my top level script and then into youtube-dl.py as the second line, but that gives another error, probably because youtube-dl is actually a binary file of some sort. The encoding line I added is
-- coding: utf-8 --
My top level file looks like this (I renamed youtube-dl.py as youtube_dl.py because python can't import modules that contain dashes in the name):
.
.
-- coding: utf-8 --
import android
import os, sys
import youtube_dl
droid = android.Android()
os.system("/storage/sdcard0/data/mydata/youtube-dl.py sfR_HWMzgyc")
youtube-dl.main()
youtube_dl.main("sfR_HWMzgyc")
execfile('/storage/sdcard0/sl4a/scripts/youtube-dl.py sfR_HWMzgyc')
.
.
I'm a little stuck right now since I don't know what to try next.
Could you provide the exact steps that you used to generate that screenshot which shows that youtube-dl was able to run all the way through? I'm running sl4a 2.6 like you.
Thanks in advance.