Skip to content

Commit 62c9d2f

Browse files
committed
Add README.md url to error messages
1 parent d13edfd commit 62c9d2f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

imdb_backup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
COOKIE_FNAME = 'imdb_cookie.txt'
1515
ZIP_FNAME = 'imdb_exported_lists.zip'
16+
README_REF = 'For more info check README.md.\n' \
17+
'[https://github.com/monk-time/imdb-backup-lists/blob/master/README.md]'
1618

1719
MList = Dict[str, str]
1820

@@ -36,7 +38,7 @@ def load_imdb_cookies():
3638
return {'id': cookie_path.read_text().strip()}
3739
else:
3840
raise FileNotFoundError(f'\n\nCreate a file "{COOKIE_FNAME}" in the script directory\n'
39-
'and put your IMDb cookie inside.\nFor more info see README.md.')
41+
f'and put your IMDb cookie inside.\n{README_REF}')
4042

4143

4244
def fetch_userid(cookies: dict) -> str:
@@ -46,8 +48,8 @@ def fetch_userid(cookies: dict) -> str:
4648
m = re.search(r'ur\d+', r.headers['Location'])
4749
if not m:
4850
raise Exception("\n\nCan't log into IMDb.\n"
49-
f"Make sure that your IMDb cookie in {COOKIE_FNAME} is correct.\n"
50-
'For more info see README.md.')
51+
f'Make sure that your IMDb cookie in {COOKIE_FNAME} is correct.\n'
52+
f'{README_REF}')
5153
return m.group()
5254

5355

0 commit comments

Comments
 (0)