Переглянути джерело

[fixed] Fake the user agent string because the Kobo API stopped responding, it just held the connection.

TnS-hun 3 роки тому
батько
коміт
902b8f1012
1 змінених файлів з 1 додано та 0 видалено
  1. 1 0
      kobo-book-downloader/Kobo.py

+ 1 - 0
kobo-book-downloader/Kobo.py

@@ -58,6 +58,7 @@ class Kobo:
 	def __init__( self ):
 		self.InitializationSettings = {}
 		self.Session = SessionWithTimeOut()
+		self.Session.headers.update( { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0" } )
 
 	# This could be added to the session but then we would need to add { "Authorization": None } headers to all other
 	# functions that doesn't need authorization.