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.
Latest posts by Surendra Anne (see all)
- Docker: How to copy files to/from docker container - June 30, 2020
- Anisble: ERROR! unexpected parameter type in action:
Fix - June 29, 2020 - FREE: JOIN OUR DEVOPS TELEGRAM GROUPS - August 2, 2019
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018