Last active
March 20, 2023 12:07
-
-
Save appastair/4548822 to your computer and use it in GitHub Desktop.
Bambuser.com Video Downloader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from optparse import OptionParser | |
parser = OptionParser() | |
parser.set_defaults(verbose=True) | |
parser.add_option('-v','--video-id',dest='video') | |
(options, args) = parser.parse_args() | |
if options.video is None: | |
exit("-v, --video-id=NUM Bambuser.com Video ID i.e. http://bambuser.com/v/5029") | |
import urllib | |
html = urllib.urlopen("http://bambuser.com/v/"+options.video) | |
from bs4 import BeautifulSoup | |
soup = BeautifulSoup(html.read()) | |
videotitle = soup.head.find('title').string | |
videothumb = soup.head.find('meta', property="og:image")['content'] | |
import re | |
videotitle = re.search("(.+)\s\|(.+)\s\|", videotitle).group(1).encode('utf8') | |
videoid = re.search(".*/(.*)\.", videothumb).group(1) | |
import os | |
os.system("wget http://archive.bambuser.com/archive/batch1/"+videoid+".flv -O "+re.escape(videotitle)+".flv") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment