Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Name : youtube_scraper.py
- Author : WestEastDevs Inc.
- Usage : youtube_scraper.py
- Main Purpose : For a given youtube video ID - retrieve the google drive URL for the same video
- Change Log :
- 27.11.2015 - Created.
- """
- import urllib2
- import re
- def get_video_url(html_result):
- """
- get_video_url() -> string
- Purpose : Get the google drive URL for a given html response
- Parameters : @html_result - The result of the HTML request
- Return Value : The URL for the Google Drive video
- """
- result = re.findall(",\"src\":\"(.*?)\"", html_result)[0]
- return result.replace("\\", "")
- def main():
- required_video = raw_input("Please insert required video ID : ")
- response = urllib2.urlopen("http://reel.pk/embed/" + required_video).read()
- print "\nThe Google Drive URL : \n\n", get_video_url(response)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement