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 7051595
In Process

The Archive Base Latest Questions

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

I need to download videos from youtube using a python script. However i am

  • 0

I need to download videos from youtube using a python script. However i am unable to get the url of the video from the youtube page.

For example, given the url: http://www.youtube.com/watch?v=5qcmCUsw4EQ&feature=g-all-u&context=G2633db8FAAAAAAAAAAA

  1. I need to download the video as a flv or any other format. Also i need to be able to download it multiple quality.
  2. I tried several scripts like youtube-dl and quvi but they all give errors and dont work. Please help. It shall be deeply appreciated.
  • 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-28T03:16:57+00:00Added an answer on May 28, 2026 at 3:16 am

    You need to parse the flashvars variable of the <embed> tag that contains the video. These change around, so some experimentation may be required to find the current variable names. Roughly speaking, you’ll want to use a libraries like mechanize to grab the HTML of the page and BeautifulSoup to parse the HTML and extract the flashvars field of the <embed> element. Then look around at the variables to figure out which one contains the video URL.

    e.g.,

      br = mechanize.Browser()
      # Browser options
      br.set_handle_equiv(True)
      br.set_handle_redirect(True)
      br.set_handle_referer(True)
      br.set_handle_robots(False)
      # Follows refresh 0 but not hangs on refresh > 0
      br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
      # User-Agent (this is cheating, ok?)
      br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
      br.open('%s?v=%s' % (YOUTUBE_URL, vidId))
      soup = BeautifulSoup.BeautifulSoup(br.response().read())
      flashVars = urllib2.urlparse.parse_qs(soup.find('embed').get('flashvars'))
      # Return the first second video source URL
      return flashVars['fmt_stream_map'][0].split('|')[1]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to download an image from some URL to my server. However, my
I need to be able to directly download certain YouTube videos using PHP. Based
Ok so I need to download some web pages using Python and did a
I need to download Base64 Encoded data from Server using HttpUrlConnection. And then decode
I need to get the contents of a HTML page from the Web, but
I want to download say 10 different video from a url at different path,lets
I need to download several files via http in Python. The most obvious way
I need to download file from FTP server and make some changes on it
I need to download images from a website, and I have the login name
so i continue from this question YouTube: get youtube title+ image+description like facebook `

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.