8thbit

Udacity Download Link Generator

Nov 18th, 2015
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. __author__ = 'Mr.8ThBiT'
  2. import argparse
  3.  
  4. def echo(courseid, coursename):
  5.     coursename = coursename.replace(' ', '%20')
  6.     print 'http://zips.udacity-data.com/{0}/{1}%20Videos.zip'.format(courseid, coursename)
  7.  
  8. if __name__ == "__main__":
  9.     parser = argparse.ArgumentParser(description="UDAYCITY download link generator by Mr.8ThBiT")
  10.     parser.add_argument('-id', help="course id [udxxx]", action='store')
  11.     parser.add_argument('-name', help='course title (Case Sensitive)')
  12.     args = vars(parser.parse_args())
  13.     if args['id'] == None or args['name'] == None:
  14.         print ('use -h command to see help')
  15.         exit(-1)
  16.     echo(args['id'], args['name'])
Add Comment
Please, Sign In to add comment