- to_screen(u'Updating to version ' + versions_info['latest'] + '...')
- version = versions_info['versions'][versions_info['latest']]
- if version.get('notes'):
- to_screen(u'PLEASE NOTE:')
- for note in version['notes']:
- to_screen(note)
+ version_id = versions_info['latest']
+
+ def version_tuple(version_str):
+ return tuple(map(int, version_str.split('.')))
+ if version_tuple(__version__) >= version_tuple(version_id):
+ to_screen('youtube-dl is up to date (%s)' % __version__)
+ return
+
+ to_screen('Updating to version ' + version_id + ' ...')
+ version = versions_info['versions'][version_id]
+
+ print_notes(to_screen, versions_info['versions'])
+
+ filename = sys.argv[0]
+ # Py2EXE: Filename could be different
+ if hasattr(sys, "frozen") and not os.path.isfile(filename):
+ if os.path.isfile(filename + '.exe'):
+ filename += '.exe'