Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RegEx to get full size image and remove CU banner #17

Open
yakk0 opened this issue Dec 9, 2020 · 0 comments
Open

Add RegEx to get full size image and remove CU banner #17

yakk0 opened this issue Dec 9, 2020 · 0 comments

Comments

@yakk0
Copy link

yakk0 commented Dec 9, 2020

thanks for doing this! It's greatly helped my Ubooquity look great. I'm not a programmer, so I apologize for not doing this the "correct" way in GitHub, but I didn't want to risk screwing anything up. I hacked on comixology-to-ubooquity.py and worked out a RegEx that gets the full sized images and remove the Comixology Unlimited banner. Can this be added to the script?
The RegEx is '._[A-Z].*?(?=.jpg)'

I changed lines 295 and 296 from

            print(' - Downloading logo from: {!r}'.format(publisher_listing.logo_url))
            logo_data = get_file(session, publisher_listing.logo_url)

to

            logourl = (re.sub('\.\_[A-Z].*?(?=\.jpg)', '', publisher_listing.logo_url))
            print(' - Downloading logo from: {!r}'.format(logourl))
            logo_data = get_file(session, logourl)

Lines 308 and 309 from:

            print(' - Downloading header from: {!r}...'.format(publisher.header_url))
            header_data = get_file(session, publisher.header_url)
            headerurl = (re.sub('\.\_[A-Z].*?(?=\.jpg)', '', publisher.header_url))
            print(' - Downloading header from: {!r}...'.format(headerurl))
            header_data = get_file(session, headerurl)

and lines 354 and 355 from:

            print('  - Downloading logo from: {!r}'.format(series_listing.logo_url))
            series_logo_data = get_file(session, series_listing.logo_url)

to

            logourl = (re.sub('\.\_[A-Z].*?(?=\.jpg)', '', series_listing.logo_url))
            print('  - Downloading logo from: {!r}'.format(logourl))
            series_logo_data = get_file(session, logourl)

I'm sure this can be done a lot more elegantly than what I put together, but this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant