Sorrow446 / MQ-DL

Tool written in Python to download streamable tracks from mora qualitas (モーラクオリタス).
100 stars 34 forks source link

not work when url is alb.xxxxxxxx #9

Closed littlealone100 closed 4 years ago

littlealone100 commented 4 years ago

the same album

this url work https://content.mora-qualitas.com/artist/yumi-matsutoya/album/dawn-purple-remastered-2019

this url not work, can't download, meet HTTP Error https://content.mora-qualitas.com/artist/yumi-matsutoya/album/alb.406030712

I also want to know how to get an album's url like the first url? When I share albums from app, it only show url like https://content.mora-qualitas.com/?id=alb.406030712

littlealone100 commented 4 years ago

Due to when I share albums from app, it only show url like https://content.mora-qualitas.com/?id=alb.xxxxxx..... I change the MQ-DL.py...

def check_url(url):
    regex = (
#       r'https://content.mora-qualitas.com/artist/([a-zA-Z-\d]+)/album/'
#       r'(alb.\d{9}|[a-zA-Z-\d*]+)(?:/track/(t.\d{9}|[a-zA-Z=\d]+))?'
        r'https://content.mora-qualitas.com/\?id='
        r'(alb.\d{9})'
    )
    m = re.match(regex, url)
    return m.group(1)

def main(alb_id)

if __name__ == "__main__":
    title()
    cfg = parse_prefs()
    auth()
    total = len(cfg['url'])
    for num, url in enumerate(cfg['url'], 1):
        print("\nAlbum {} of {}:".format(num, total))
        try:
#           alb_art, alb_id, tra_id = check_url(url)
            alb_id = check_url(url)
        except AttributeError:
            print("Invalid url:", url)
            continue
#       alb_id = client.resolve_id(alb_art, alb_id)
        try:
            main(alb_id)
        except Exception as e:
            print("Album failed.")
            err(e)
Sorrow446 commented 4 years ago

this url not work, can't download, meet HTTP Error

Fixed. The vars were named wrongly and the client's resolve function was being called instead of the main script's one.

The first two URLs are from the Windows app. Never seen this before: ?id=alb.406030712.

littlealone100 commented 4 years ago

Fixed. The vars were named wrongly and the client's resolve function was being called instead of the main script's one.

The first two URLs are from the Windows app. Never seen this before: ?id=alb.406030712.

I get url ?id=alb.xxxxxx from Android app.

I didn't use windows app because it only supports win10.

Sorrow446 commented 4 years ago

Would require a regex tweak. Will do this in the future. For now you'll have to manually convert them.

Edit: This will work, but for Android URLs ONLY.

regex = (
    r'https://content.mora-qualitas.com/\?id=()(alb\.\d{9})()'
)

I'll merge this into the main regex another time

Edit 2: No need to tweak now. https://github.com/Sorrow446/MQ-DL/commit/1aca01ef2da5fbdc69905daa5302f6f8472c9e52 :).

224mrv commented 4 years ago

image I tried with androi app shared link ?id=alb.xxxxx and it didn't work for me. is it work for everyone ?

Sorrow446 commented 4 years ago

It's not pushed to the Windows build yet.

EDIT: pushed.

sorrowfan commented 4 years ago

i have mq account but i have not added payment information nor completed signup. when i use that details in config.json.when i run cmd It shows signedin successfully which means i can download right?

Sorrow446 commented 4 years ago

The script doesn't have any subscription-checking code, so it'll run. Their API won't return any track streams to you, though. You must have had a subscription at some point (trial will also work).