1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-23 08:13:14 +00:00

Fixed titulky provider UnicodeEncodeError

This commit is contained in:
Samuel Bartík 2022-03-09 20:08:26 +01:00 committed by GitHub
parent d384b9307b
commit 8a9fbbeaec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@ import math
import re
import zipfile
from random import randint
from urllib.parse import urlparse, parse_qs
from urllib.parse import urlparse, parse_qs, quote
from threading import Thread
import rarfile
@ -314,7 +314,7 @@ class TitulkyProvider(Provider, ProviderSubtitleArchiveMixin):
# GET request a page. This functions acts as a requests.session.get proxy handling expired cached cookies
# and subsequent relogging and sending the original request again. If all went well, returns the response.
def get_request(self, url, ref=None, __recursion=0):
def get_request(self, url, ref=server_url, __recursion=0):
# That's deep... recursion... Stop. We don't have infinite memmory. And don't want to
# spam titulky's server either. So we have to just accept the defeat. Let it throw!
if __recursion >= 5:
@ -327,7 +327,7 @@ class TitulkyProvider(Provider, ProviderSubtitleArchiveMixin):
url,
timeout=self.timeout,
allow_redirects=False,
headers={'Referer': ref if ref else self.server_url})
headers={'Referer': quote(ref)})
# Check if we got redirected because login cookies expired.
# Note: microoptimization - don't bother parsing qs for non 302 responses.