I used this tutorial to install youtube-dl and QPython on Android

But when I run the command youtube-dl https://www.youtube.com/watch?v=D5nxkynkSDI It throws the following error:

[youtube] D5nxkynkSDI: Downloading webpage
[youtube] D5nxkynkSDI: Downloading video info webpage
[youtube] D5nxkynkSDI: Extracting video information
[youtube] D5nxkynkSDI: Downloading MPD manifest
ERROR: unable to open for writing: [Errno 30] Read-only file system: 'Ezekiel Elliot Touchdown Run Dallas Cowboys Win Against Pittsburg Steelers Fan Reaction Upset-D5nxkynkSDI.webm.part'

As per the answer given here: I tried creating /etc/youtube-dl.conf using ESFileExplorer but failed to do so. The device isn't rooted.

So here are my questions:

  1. How do I enable writing permissions? or Specify path to a directory on external SD card as output directory?

  2. I actually wanted to batch download few links using youtube-dl -a 'batchlinks.txt but I don't understand the current working directory. So I don't know where to put my 'batchlinks.txt'

  3. Do I need to go to "QPython Dashboard > Libraries > PIP Console" to run youtube-dl? Why can't I run youtube-dl from "QPython Dashboard > Console"?

Note: The 'batchlinks.txt' doesn't contain YouTube links.

3 Answers 3


I solved this by using a Python script inside which I used youtube-dl not from the command line but with the YoutubeDL API (their documentation is good). Then, add this code Python script in which you are using the YoutubeDL API.

import os

It seems that it is trying to write to a read only file system. Try and use the -o argument to specify the downloads folder.

youtube-dl -o /sdcard/Downloads/YourVideo.mp4 https://www...

  1. Try to identify where the sample scripts are stored on the device: I found it by clicking under 'Programs' which showed they were stored at (Android 7.0) :


I'm thinking this means the app has permission to write under this directory. Then I created 'ytdl' using mkdir - either using adb or from within the shell inside Qpython (this is the one location that mkdir does work when doing it from within Qpython.

youtube-dl -o /storage/emulated/0/qpython/ytdl https://www.youtube.com/watch?v=D5nxkynkSDI

With the added benefit that this runs in the background, not sure if Doze mode will pause this, so leave it running in the foreground (by disabling sleep).

  1. Navigate to the


and insert a text file batchlinks.txt at this location (possibly with a file manager (I used Solid Explorer)). Then while in that directory run (you don't need to specify -o since you are running from this dir and you shouldn't have to specify batchlinks.txt because it should see it from the current location (if it doesn't include the absolute path):

youtube-dl -a batchlinks.txt
  1. Same place you installed youtube-dl from: Libraries -> pip console where the cursor is:

--> youtube-dl --version

Also you can come out of the pip shell to the phones shell, and run from there (I did it by doing Cntrl-Z on a bluetooth keyboard connected to the phone).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .