Small fixes
This commit is contained in:
parent
3910a39571
commit
6f35e17fdd
@ -49,7 +49,7 @@ class iTunes(BaseService):
|
|||||||
def cli(ctx, **kwargs):
|
def cli(ctx, **kwargs):
|
||||||
return iTunes(ctx, **kwargs)
|
return iTunes(ctx, **kwargs)
|
||||||
|
|
||||||
def __init__(self, ctx, title: str, movie, checkall, sf: bool):
|
def __init__(self, ctx, title: str, movie, checkall, sf: int):
|
||||||
super().__init__(ctx)
|
super().__init__(ctx)
|
||||||
self.parse_title(ctx, title)
|
self.parse_title(ctx, title)
|
||||||
|
|
||||||
@ -298,6 +298,12 @@ class iTunes(BaseService):
|
|||||||
#if not re.match(r"https?://(?:geo\.)?itunes\.apple\.com/", self.title):
|
#if not re.match(r"https?://(?:geo\.)?itunes\.apple\.com/", self.title):
|
||||||
# raise ValueError("Url must be an iTunes URL...")
|
# raise ValueError("Url must be an iTunes URL...")
|
||||||
|
|
||||||
|
cc = self.session.cookies.get_dict()["itua"]
|
||||||
|
r = self.session.get("https://gist.githubusercontent.com/BrychanOdlum/2208578ba151d1d7c4edeeda15b4e9b1/raw/8f01e4a4cb02cf97a48aba4665286b0e8de14b8e/storefrontmappings.json").json()
|
||||||
|
for g in r:
|
||||||
|
if g['code'] == cc:
|
||||||
|
self.storefront = g['storefrontId']
|
||||||
|
|
||||||
environment = self.get_environment_config()
|
environment = self.get_environment_config()
|
||||||
if not environment:
|
if not environment:
|
||||||
raise self.log.exit("Failed to get iTunes' WEB TV App Environment Configuration...")
|
raise self.log.exit("Failed to get iTunes' WEB TV App Environment Configuration...")
|
||||||
|
|||||||
@ -71,8 +71,10 @@ def main(debug):
|
|||||||
if len(sys.argv) > 1 and sys.argv[1].lower() == "dl":
|
if len(sys.argv) > 1 and sys.argv[1].lower() == "dl":
|
||||||
sys.argv.pop(1)
|
sys.argv.pop(1)
|
||||||
|
|
||||||
|
try:
|
||||||
sys.set_int_max_str_digits(10000) # This is necessary for str to int conversion to work
|
sys.set_int_max_str_digits(10000) # This is necessary for str to int conversion to work
|
||||||
|
except:
|
||||||
|
pass
|
||||||
dl()
|
dl()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user