diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index 17f2d0a..883dce9 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -292,21 +292,24 @@ class FanFictionDownLoaderPlugin(InterfaceAction): options['personal.ini'] = prefs['personal.ini'] - try: - adapter.getStoryMetadataOnly() - except exceptions.FailedToLogin: - print("Login Failed, Need Username/Password.") - userpass = UserPassDialog(self.gui,url) - userpass.exec_() # exec_ will make it act modal - if userpass.status: - adapter.username = userpass.user.text() - adapter.password = userpass.passwd.text() + ## three tries, that's enough if both user/pass & is_adult needed, + ## or a couple tries of one or the other + for x in range(0,2): + try: + adapter.getStoryMetadataOnly() + except exceptions.FailedToLogin: + print("Login Failed, Need Username/Password.") + userpass = UserPassDialog(self.gui,url) + userpass.exec_() # exec_ will make it act modal + if userpass.status: + adapter.username = userpass.user.text() + adapter.password = userpass.passwd.text() - except exceptions.AdultCheckRequired: - if question_dialog(self.gui, 'Are You Adult?', '
'+ - "%s requires that you be an adult. Please confirm you are an adult in your locale:"%url, - show_copy_button=False): - adapter.is_adult=True + except exceptions.AdultCheckRequired: + if question_dialog(self.gui, 'Are You Adult?', '
'+ + "%s requires that you be an adult. Please confirm you are an adult in your locale:"%url, + show_copy_button=False): + adapter.is_adult=True # let other exceptions percolate up. story = adapter.getStoryMetadataOnly() diff --git a/calibre-plugin/jobs.py b/calibre-plugin/jobs.py index 1ab49ad..287809d 100644 --- a/calibre-plugin/jobs.py +++ b/calibre-plugin/jobs.py @@ -85,7 +85,7 @@ def do_download_worker(book_list, options, count = count + 1 notification(float(count)/total, 'Downloaded Story') # Add this job's output to the current log - print('Logfile for book ID %s (%s)'%(book_id, book['title'])) + print('Logfile for book ID %s (%s)'%(book_id, job._book['title'])) print(job.details) if count >= total: