Below are some of my scripts which I used to download videos for offline viewing.

Script1: One day I come across a motivational blog which I liked it a a lot. Below script will download all the podcasts from that site for my offline listening 

	#!/usr/bin/env python
import urllib2
import re
import subprocess
for i in range(5):
    URL=urllib2.urlopen('http://getbusylivingblog.com/podcasts/page/' + str(i)+'/')
    for i in re.findall('[a-zA-Z0-9_]+.mp3', URL.read()):
        subprocess.call(["youtube-dl", "http://traffic.libsyn.com/bennyhsu/"+i])    

Script2: I created below script to download video files from puppetlabs webinars which is good resource to know what is happening in and around Puppet labs.

	#!/usr/bin/env python
import urllib2, re, subprocess
response = urllib2.urlopen('http://puppetlabs.com/misc/webinars')
html = response.read()
data1 = re.findall('/webinars/[a-z0-9-]+', html)
for link1 in data1:
    str1 = 'http://puppetlabs.com'+link1
    response2 = urllib2.urlopen(str1)
    html2 = response2.read()
    data2 = re.findall('player.vimeo.com/video/[0-9]+',html2)
    for link2 in data2:
        subprocess.call(["./youtube-dl", link2])
response.close()

Will update this post with more of my scripts.

The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.