mirror of
https://source.perfectable.org/nivertius/napi.git
synced 2025-07-02 03:24:55 +02:00
nice message when there is no movie file
This commit is contained in:
parent
383c9af291
commit
8e1f72ab62
1 changed files with 6 additions and 1 deletions
7
napi
7
napi
|
@ -35,7 +35,12 @@ if(len(sys.argv)==1):
|
|||
|
||||
d = md5.new()
|
||||
movie_filename = sys.argv[1]
|
||||
d.update(open(movie_filename).read(10485760))
|
||||
try:
|
||||
with open(movie_filename, "r") as movie_file:
|
||||
d.update(movie_file.read(10485760))
|
||||
except IOError:
|
||||
print "%s: No such file" % movie_filename
|
||||
sys.exit(2)
|
||||
|
||||
def download_subtitles(digest):
|
||||
request_data = {
|
||||
|
|
Loading…
Add table
Reference in a new issue