Thanks to visit codestin.com
Credit goes to jugad2.blogspot.com

Showing posts with label sitar. Show all posts
Showing posts with label sitar. Show all posts

Wednesday, December 18, 2013

Download YouTube thumbnails with micawber and wget


By Vasudev Ram



I had blogged about micawber earlier, here:

Micawber gets rich content from URLs

Among the data that micawber returns for a URL, is the thumbnail, if it is a video, for example. So I thought of writing a program to download the thumbnail for a given YouTube video using micawber and the wget Python library.

Here's the code for download_youtube_thumbnails.py:

# download_youtube_thumbnails.py
# A program to download YouTube video thumbnail images.
# Author: Vasudev Ram - http://www.dancingbison.com
# Uses the micawber and wget Python libraries.

# micawber: https://github.com/coleifer/micawber
# wget: https://pypi.python.org/pypi/wget

import os
import os.path
import micawber
import wget

def download_youtube_thumbnail(video_url, video_name):

    # load up rules for some default providers, such as youtube and flickr
    providers = micawber.bootstrap_basic()

    ret_val = providers.request(video_url)
    if 'thumbnail_url' in ret_val:
        thumbnail = wget.download(ret_val['thumbnail_url'], bar=None)
        root, ext = os.path.splitext(thumbnail)
        new_name = 'thumb_' + video_name + ext
        os.rename(thumbnail, new_name)
        print "Thumbnail downloaded: ", new_name
    else:
        print "'thumbnail_url' key not found in ret_val dict"

def main():

    try:
        # Download the thumbnail for the video of the album 
        # 'Rarely Heard Ragas' by Vilayat Khan.
        download_youtube_thumbnail(
        "http://www.youtube.com/watch?feature=player_detailpage&v=Qim2av-SRwU",
        'Vilayat_Khan_Rarely_Heard_Ragas')
    except Exception, e:
        print "ERROR: Caught exception: " + repr(e)
        sys.exit(1)

if __name__ == "__main__":
    main()

# EOF



And here is its output - the thumbnail - when given the URL for Vilayat Khan playing Rarely Heard Ragas on the sitar:


- Vasudev Ram - Dancing Bison Enterprises

Contact Page



More Python posts.

Sunday, October 20, 2013

Music video: Sitar - Vilayat khan - Rarely Heard Ragas


By Vasudev Ram

Came across this sitar performance by Ustad Vilayat Khan recently on YouTube via a search:

Vilayat Khan - Rarely Heard Ragas

I had the CD of the performance some time ago. Like it a lot.

It is good music to listen to while working (IMO).

The video is also embedded below.



- Vasudev Ram - Dancing Bison Enterprises

Contact me


Wednesday, December 12, 2012

Sitarist Ravi Shankar passes away

Washington Post

The above link is a Washington Post article about Ravi Shankar, one of my favorite sitar players.

Below is a link to The Beatles' song Here Comes The Sun. Ravi Shankar influenced the Beatles, particularly George Harrison.

http://m.youtube.com/watch?v=CffNTvoa3CU&desktop_uri=%2Fwatch%3Fv%3DCffNTvoa3CU