Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1057881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:56:26+00:00 2026-05-16T17:56:26+00:00

youtube-dl is a Python script that allows one to download YouTube videos. It supports

  • 0

youtube-dl is a Python script that allows one to download YouTube videos. It supports an option for batch downloads:

-a FILE, --batch-file=FILE
file containing URLs to download (‘-‘ for stdin)

I want to setup some sort of queue so I can simply append URLs to a file and have youtube-dl process them. Currently, it does not remove files from the batch file. I see the option for ‘-‘ stdin and don’t know if I can use this to my advantage.

In effect, I’d like to run youtube-dl as some form of daemon which will check the queue file and download the contained file names.

How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:56:26+00:00Added an answer on May 16, 2026 at 5:56 pm

    The tail -f will not work because the script reads all the input at once.

    It will work if you modify the script to perform a continuous read of the batch file.

    Then simply run the script as:

    % ./youtube-dl -a batch.txt -c
    

    When you append some data into batch.txt, say:

    % echo "http://www.youtube.com/watch?v=j9SgDoypXcI" >>batch.txt
    

    The script will start downloading the appended video to the batch.

    This is the patch you should apply to the latest version of “youtube-dl”:

    2278,2286d2277
    <       while True:
    <           batchurls = batchfd.readlines()
    <           if not batchurls:
    <               time.sleep(1)
    <               continue
    <           batchurls = [x.strip() for x in batchurls]
    <           batchurls = [x for x in batchurls if len(x) > 0]
    <           for bb in batchurls:
    <               retcode = fd.download([bb])
    

    Hope it helps,
    Happy video watching
    😉

    NOTE: Due to code restructuring this patch will no longer work. Would be interested to see if this could be added to the upstream code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to download videos from youtube using a python script. However i am
When I try to download the playlist with the youtube-dl Python script I get
How can I call the gd:rating XML file using the Python YouTube GData API?
I am creating a python gtk program which uploads videos to youtube in ubuntu
How can I download the audio from a YouTube video with Windows, using Python
I'm writing an application using Python that adds videos to a user's playlist on
I'm using the python client library to upload videos to youtube. I need to
Does Any one know how to convert a Youtube video into an mp3 file.
I have a python class called Video, which represents YouTube videos. Given the ID
Can YouTube videos be played from within an AndroidOS without launching the separate YouTube

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.