1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-12-27 00:37:55 +01:00

Do not update if already up-to-date (Closes #166)

This commit is contained in:
Philipp Hagemeister 2011-09-15 20:09:30 +02:00
parent 7b1a2bbe17
commit 2736595628

View File

@ -3409,6 +3409,11 @@ def updateSelf(downloader, filename):
try:
urlh = urllib.urlopen(UPDATE_URL)
newcontent = urlh.read()
vmatch = re.search("__version__ = '([^']+)'", newcontent)
if vmatch is not None and vmatch.group(1) == __version__:
downloader.to_screen('youtube-dl is up-to-date (' + __version__ + ')')
return
finally:
urlh.close()
except (IOError, OSError), err: