to download flash videos

This is the place for queries that don't fit in any of the other categories.

to download flash videos

Postby metulburr » Tue Apr 02, 2013 6:12 pm

I think its flash, not sure?

but the cold dead hand video: ... jim-carrey

How would you auto downjload via python?

I checked /tmp directory upon loading the video. But nothing is there?
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
User avatar
Posts: 2162
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: to donwload flash videos

Postby Yoriz » Tue Apr 02, 2013 6:21 pm

I see this mentioned on python redit the other day, dont know if its any good.
youtube-dl is a small command-line program to download videos from and a few more sites. It requires the Python interpreter (2.6, 2.7, or 3.3+), and it is not platform specific. It should work in your Unix box, in Windows or in Mac OS X. It is released to the public domain, which means you can modify it, redistribute it or use it however you like.
New Users, Read This
Join the #python-forum IRC channel on!
User avatar
Posts: 1630
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: to download flash videos

Postby snippsat » Tue Apr 02, 2013 7:29 pm

Fast an hacky solution,i look trough source code with chrome-developer-tools(same as Firebug).
In a 2500 lines html file with a lot javascript,i see that file is in mp4 format and they load it with a web flash player.
So as i test i use my Requests script here
Code: Select all
import requests

r = requests.get("", stream=True)
with open('cold_dead_jim_carrey.mp4', 'wb') as handle:
    for block in r.iter_content(1024):
        if not block:

Size of file is 111MB,and i got a working mp4 file on my HDD.
User avatar
Posts: 1225
Joined: Thu Feb 21, 2013 12:04 am

Re: to download flash videos

Postby snippsat » Wed Apr 03, 2013 12:46 pm

I looked a little more at Funny or die,and for fun i did write some code that download video to HDD.
Funny or die has 3 quality format of each video,low(110 kbps),medium(600 kbps) and high(2500 kbps)*not all videos has high quality.
To test code paste in url from video you want to download and choose quality(that's all then just run script).
Video will be saved in folder you run script from.
I have only tested code in Windows,will test in Linux later.
Code: Select all
import requests
import re

def funny_id(url='url'):
    '''Take video id from url'''
    url_read = requests.get(url)
    text = url_read.text
    id_vid ='''<source src="*)/v600.mp4" />''', text)

def quality(choosen_quality, funny_id):
    '''Choose quality and insert funny_id'''
    vid_quality =\
    {'low': '',
     'med':  '',
     'high': ''}
    adress = vid_quality[choosen_quality]
    first = adress.partition('v/')[:2]
    last = adress.partition('v/')[2:]
    video_adress = '{}{}{}'.format(first[0]+first[1], funny_id, last[0])
    return video_adress

def download(fin_url):
    '''Download given url'''
    req = requests.get(fin_url, stream=True)
    with open('your_video.mp4', 'wb') as handle:
        for block in req.iter_content(4096):
            if not block:

if __name__ == '__main__':
    # Paste in in url from funnyordie
    url = ''
    #Choose video quality you want(low, med, high)
    video_quality = 'high'

    #-----| Run it |-------
    funny_id = funny_id(url)
    fin_url = quality(video_quality, funny_id)
User avatar
Posts: 1225
Joined: Thu Feb 21, 2013 12:04 am

Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 4 guests