py.user.next
rfc. json. grammarНет там никаких проблем с зависимостью от символов конца строки.
насколько я понимаю в этом куске:
def Playlistparser(self):
try:
s = requests.Session()
s.mount('file

/', FileAdapter())
with s.get(config.url, headers=self.headers, proxies=config.proxies, stream=False, timeout=30) as playlist:
if playlist.status_code != 304:
if playlist.encoding is None: playlist.encoding = ‘utf-8’
self.headers = gevent.time.strftime('%a, %d %b %Y %H:%M:%S %Z', gevent.time.gmtime(self.playlisttime))
self.playlist = PlaylistGenerator(m3uchanneltemplate=config.m3uchanneltemplate)
self.picons = picons.logomap
self.channels = {}
m = requests.auth.hashlib.md5()
self.logger.info('Playlist %s downloaded' % config.url)
try:
for channel in playlist.json():
channel = name = channel.get('name', '')
channel = url = ‘acestream

/%s’ % channel.get('url')
channel = channel.get('cat')
if not ‘logo’ in channel: channel = picons.logomap.get(name)
self.picons = channel
if url.startswith(('acestream

/', ‘infohash

/’)) \
or (url.startswith(('http

/','https

/')) and url.endswith(('.acelive', ‘.acestream’, ‘.acemedia’, ‘.torrent’))):
self.channels = url
channel = quote(ensure_str('%s.ts' % name),'')
self.playlist.addItem(channel)
m.update(name.encode('utf-8'))
except Exception as e:
self.logger.error(“Can't parse JSON! %s” % repr(e))
return