tolino-python icon indicating copy to clipboard operation
tolino-python copied to clipboard

How up to date are the partner ids?

Open step21 opened this issue 6 years ago • 15 comments

Hi,

I would like to add support for 'meineBuchHandlung' (now genialokal, but in tolino app still called meineBuchHandlung.) When looking at the code to add this, I noticed that the id (80) that you assigned to libri is also used in my case for meineBuchHandlung. So is this an error or does it maybe mean that libri, as a wholesaler and reseller, just resells their stuff to meineBuchHandlung? Though still this would mean that either the id is not unique or that while libre acts as a reseller, it would still add a unique id for each client (if they have more). I am leaning towards the latter, as the id has to be somewhat unique to display custom branding etc. (unless it is differentiated elsewhere)

step21 avatar Jul 25 '19 14:07 step21

I do not maintain this code much anymore, since my own Tolino is broken by now and there has been no help whatsoever from inside Tolino to allow a 3rd party library to legally access the user's cloud. Therefore, no, the partner ids are not up-to-date, sorry.

hzulla avatar Jul 25 '19 14:07 hzulla

Ok, thanks for the fast info. If I do add something, would you accept pull requests though?

step21 avatar Jul 25 '19 14:07 step21

Yes. Thanks!

hzulla avatar Jul 25 '19 15:07 hzulla

Hey, did you ever finish implementing the login for geniallokal?

benneti avatar Dec 20 '21 21:12 benneti

Hey. Unfortunately, I never did get around to properly doing it. I think I got all the required URLs, but it was also a bit messy to find out, as apparently different partners use different url schemes. I might revisit it in the new year.

step21 avatar Dec 21 '21 11:12 step21

yeah before seeing this I tried around for a bit yesterday but only got a few 503s and 200s as responses. If you have the URLs you found around that would be really nice then I'll try it again! (Despite thinking I got the correct login url, I did not get very far)

benneti avatar Dec 21 '21 11:12 benneti

Hey, so this is what I had in tolinocloud.py - id is 80. Though I cannot remember how much I tested (that is if it worked) so it might not be much use to you.

added to partner_name:

80 : 'meineBuchhandlung',

...

      80: {
      # meineBuchhandlung.de / genialokal
      'client_id'        : 'meinebuchhandlung0501html5readerV0001',
      'scope'            : 'e-publishing',
      'signup_url'       : 'https://lore.shop-asp.de/go/my_dry/my_register_aos/',
      'profile_url'      : 'https://lore.shop-asp.de/go/my_dry/my_login/receiver_object/my_login/',
      'token_url'        : 'https://lore.shop-asp.de/shop/kundenkonto/oauth/token',
      'revoke_url'       : 'https://lore.shop-asp.de/shop/kundenkonto/oauth/revoke',
      'auth_url'         : 'https://lore.shop-asp.de/shop/kundenkonto/oauth/authorize', #'https://lore.shop-asp.de/oauth/authorize',
      'login_url'        : 'https://lore.shop-asp.de/shop/kundenkonto/login',
      'login_form'       : {
            'username' : 'login-email',
            'password' : 'login-password',
            'extra'    : {
            
                    'login' : ''
                
                },
            },
            #x_web_aspde.skinId
            # https://lore.shop-asp.de/shop/kundenkonto/oauth/authorize?client_id=meinebuchhandlung0501html5readerV0001&response_type=code&scope=e-publishing&redirect_uri=https%3A%2F%2Fwebreader.mytolino.com%2Flibrary%2F
            # https://bosh.pageplace.de/bosh/rest
      'x_web_aspde.skinId' : 'web_aspde_de',
      'login_cookie'     : 'session',
      'logout_url'       : 'https://lore.shop-asp.de/go/my_dry/my_logout/',
      'reader_url'       : 'https://webreader.mytolino.com/library/',
      'register_url'     : 'https://bosh.pageplace.de/bosh/rest/v2/registerhw',
      'devices_url'      : 'https://bosh.pageplace.de/bosh/rest/handshake/devices/list',
      'unregister_url'   : 'https://bosh.pageplace.de/bosh/rest/handshake/devices/delete',
      'upload_url'       : 'https://bosh.pageplace.de/bosh/rest/upload',
      'delete_url'       : 'https://bosh.pageplace.de/bosh/rest/deletecontent',
      #'inventory_url'    : 'https://bosh.pageplace.de/bosh/rest/inventory/delta',
      'inventory_url'    : 'https://inventory.pageplace.de', # https%3A%2F%2Fwebreader.mytolino.com%2Flibrary%2F
      'downloadinfo_url' : 'https://bosh.pageplace.de/bosh/rest//cloud/downloadinfo/{}/{}/type/external-download'
      }
    }

step21 avatar Dec 21 '21 11:12 step21

yeah looks similar to what I have got, but I also needed 'login_form_url' : 'https://lore.shop-asp.de/oauth/authorize', and at the appropriate places params['x_web_aspde.skinId'] : c['x_web_aspde.skinId'] but the oauth request still fails

benneti avatar Dec 21 '21 13:12 benneti

I figured out that using this https://github.com/darkphoenix/tolino-calibre-sync/commit/9db2405c56b45fecb2bd4a25bcb1289417deb8cf and is much simpler (and IMHO more elegant as I do not store a plaintext password in a config file)

benneti avatar Dec 22 '21 21:12 benneti

Thanks for mentioning this. Looks good! Will you do a PR :)

step21 avatar Dec 26 '21 14:12 step21

I am not sure what you mean, I was using the linked fork as is, but i have to report that the tokens i got this way did not survive very long. So for me it was not a feasable solution and for now ill put the files in a cloud folder and download via the webbrowser... PS: if you only use the tolinoclient.py script of the fork you do not need calibre.

benneti avatar Dec 26 '21 21:12 benneti

Ah, well I thought you still would need to add the reseller id. And thanks for the P.S. I actually also do not use calibre currently, but makes sense that you can just use it without calibre.

step21 avatar Dec 28 '21 10:12 step21

PSA: Hello there. I have stopped maintaining this library, as I do not own a Tolino anymore. If this library is still useful to you, I'd want to hand it over to a new maintainer. Thank you.

hzulla avatar Jan 03 '22 07:01 hzulla

@hzulla It is still useful to me. But not sure how much time I could invest. @benneti did you really use the linked fork 'as is' or did you add the reseller id and urls? So far it only fails for me.

step21 avatar Jan 08 '22 23:01 step21

Yeah sorry, you can change any the id from thalia.de. to the one you need as only the ones that are the same are necessary if you use the token.

benneti avatar Jan 09 '22 07:01 benneti