mirror of
https://github.com/derrod/legendary.git
synced 2025-01-03 04:45:28 +00:00
[core] Always get all base urls
This commit is contained in:
parent
9f2b18fd90
commit
20a477d20f
|
@ -321,11 +321,14 @@ class LegendaryCore:
|
||||||
if len(m_api_r['elements']) > 1:
|
if len(m_api_r['elements']) > 1:
|
||||||
raise ValueError('Manifest response has more than one element!')
|
raise ValueError('Manifest response has more than one element!')
|
||||||
|
|
||||||
|
manifest_data = None
|
||||||
manifest_info = m_api_r['elements'][0]
|
manifest_info = m_api_r['elements'][0]
|
||||||
for manifest in manifest_info['manifests']:
|
for manifest in manifest_info['manifests']:
|
||||||
base_url = manifest['uri'].rpartition('/')[0]
|
base_url = manifest['uri'].rpartition('/')[0]
|
||||||
if base_url not in base_urls:
|
if base_url not in base_urls:
|
||||||
base_urls.append(base_url)
|
base_urls.append(base_url)
|
||||||
|
if manifest_data:
|
||||||
|
continue
|
||||||
|
|
||||||
params = dict()
|
params = dict()
|
||||||
if 'queryParams' in manifest:
|
if 'queryParams' in manifest:
|
||||||
|
@ -335,7 +338,9 @@ class LegendaryCore:
|
||||||
self.log.debug(f'Downloading manifest from {manifest["uri"]} ...')
|
self.log.debug(f'Downloading manifest from {manifest["uri"]} ...')
|
||||||
r = self.egs.unauth_session.get(manifest['uri'], params=params)
|
r = self.egs.unauth_session.get(manifest['uri'], params=params)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return r.content, base_urls
|
manifest_data = r.content
|
||||||
|
|
||||||
|
return manifest_data, base_urls
|
||||||
|
|
||||||
def get_uri_manfiest(self, uri):
|
def get_uri_manfiest(self, uri):
|
||||||
if uri.startswith('http'):
|
if uri.startswith('http'):
|
||||||
|
|
Loading…
Reference in a new issue