orly icon indicating copy to clipboard operation
orly copied to clipboard

Fix SubscriptionExpired error when the subscription is still valid

Open IrvanFza opened this issue 1 year ago • 1 comments

This PR fixes the SubscriptionExpired error while the current subscription is still active. Turn out that when the subscription is still active, the response doesn't have a cancellation_date value. So I skip the entire expiration check if cancellation_date is empty.

Active subscription response example:

BillingInfo {
    subscription: SubscriptionInfo {
        cancellation_date: None,
    },
    trial: TrialInfo {
        trial_expiration_date: Some(
            "2019-11-17T04:02:39.550054Z",
        ),
    },
}

Related discussion: https://github.com/hurlenko/orly/pull/5#issuecomment-1636152754

IrvanFza avatar May 10 '24 18:05 IrvanFza

P.S.: This is the first time I read and write code in Rust, so please share your thoughts if the code is bad.

IrvanFza avatar May 10 '24 18:05 IrvanFza

Hi! I've used a bit different approach but thanks anyway! The fix has been released in version 0.1.6

hurlenko avatar Jul 02 '24 19:07 hurlenko

Today I have the same problem with credentials and I didn't understand which cookie to use, I tried them all without any success.

theRedCount avatar Jul 22 '24 07:07 theRedCount

@theRedCount Can you elaborate? What kind of subscription you have (corporate, personal), give some logs. What cookies you used, how you passed them as cli args?

hurlenko avatar Jul 22 '24 09:07 hurlenko

How i test cookie authorization - go to the website, login, open any book, look for request cookie, copy it all, run orly

orly --cookie "$(pbpaste)" <book_id>

hurlenko avatar Jul 22 '24 09:07 hurlenko