Giter Site home page Giter Site logo

Comments (14)

nigels0 avatar nigels0 commented on August 14, 2024 1

Iā€™m getting this:

core-ssh alexa]$ ./alexa_remote_control.sh -a
cookie expired, logging in again ...
date: invalid date '24 Feb 2043 02:55:39 GMT'
date: invalid date '24 Feb 2043 02:55:39 GMT'
date: invalid date '24 Feb 2043 02:55:39 GMT'
date: invalid date '2 Mar 2023 02:55:39 GMT'
date: invalid date '2 Mar 2023 02:55:39 GMT'
trying to get CSRF from handlebars
trying to get CSRF from devices-v2
ERROR: no CSRF cookie received

from alexa-remote-control.

Korki67 avatar Korki67 commented on August 14, 2024

hi there, I also get this sometimes when I login using refresh token:

date: invalid date '15.09.2042 22:45:43 GMT'

I got this on 15.09.2022 22:45:43 GMT, so it seems someone added 20 years ...
Despite error message, all is working fine and seems to have no impact.
I assume it is an error at Amazon and not an error in the great script here ...

Regards,
Horst

from alexa-remote-control.

nodev11 avatar nodev11 commented on August 14, 2024

The errors are thrown by the function "toEpoch()" which calls the "date" command multiple times with wrong parameters.

from alexa-remote-control.

Tloram avatar Tloram commented on August 14, 2024

Iā€™m getting this:

core-ssh alexa]$ ./alexa_remote_control.sh -a cookie expired, logging in again ... date: invalid date '24 Feb 2043 02:55:39 GMT' date: invalid date '24 Feb 2043 02:55:39 GMT' date: invalid date '24 Feb 2043 02:55:39 GMT' date: invalid date '2 Mar 2023 02:55:39 GMT' date: invalid date '2 Mar 2023 02:55:39 GMT' trying to get CSRF from handlebars trying to get CSRF from devices-v2 ERROR: no CSRF cookie received

Same issue here. Started about a month ago, have not found a solution yet.

from alexa-remote-control.

Korki67 avatar Korki67 commented on August 14, 2024

Hi there,

please note again that I am just another very happy user of this wonderful script.

My system is still working fine. I did get and I may still do get the error of the year 2043-ish. In my system, it is only a nuisance but does not cause any real problem. All is working fine.

Are you using the refresh_token? I am using it. Perhaps you create a new refresh_token?

It may be that you got two issues: a real one that is causing "no cookie received" plus the fake one of 2043 messages?

Regards,
Horst

from alexa-remote-control.

anyone2 avatar anyone2 commented on August 14, 2024

macOS and few other platforms do not have a '-d' option for the date command.

date: illegal option -- d
usage: date [-jnRu] [-r seconds|file] [-v[+|-]val[ymwdHMS]]
[-I[date | hours | minutes | seconds]]
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]

So the last update is not going work on some platforms. They will need to keep using the prior version.

Do you need to perform the toEpoch() function on all systems?

Also...like the previous person...extremely happy with this project.

from alexa-remote-control.

adn77 avatar adn77 commented on August 14, 2024

We're receiving a JSON string with cookie expiration dates in the form 24 Feb 2043 02:55:39 GMT
I first tried using JQ's strptime for converting that to a Unix timestamp (as curl expects it in its cookie jar).
If that worked for you - stick with v0.20d. Unfortunately this was dependent on JQ's version.

If somebody has a more portable approach, let's try that šŸ˜ƒ

from alexa-remote-control.

nodev11 avatar nodev11 commented on August 14, 2024

So the solution is simple as that?

# date -d "24 Feb 2043 02:55:39 GMT" -u +"%s"
date: invalid date '24 Feb 2043 02:55:39 GMT'
# date -D "24 Feb 2043 02:55:39 GMT" -u +"%s"
1687427313

from alexa-remote-control.

anyone2 avatar anyone2 commented on August 14, 2024

Neither "-d" nor "-D" are available in macOS and other BSD-based systems. Below is the equivalent command.

 :date -j -f "%d %b %Y %H:%M:%S %Z" "24 Feb 2043 02:55:39 GMT" +"%s"
2308359339

 :date -d "24 Feb 2043 02:55:39 GMT" -u +"%s"
date: illegal option -- d
usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
            [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
            [[[[mm]dd]HH]MM[[cc]yy][.SS] | new_date] [+output_fmt]

 :date -D "24 Feb 2043 02:55:39 GMT" -u +"%s"
date: illegal option -- D
usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
            [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
            [[[[mm]dd]HH]MM[[cc]yy][.SS] | new_date] [+output_fmt]
 :

from alexa-remote-control.

adn77 avatar adn77 commented on August 14, 2024

I added a detection for OSX and BSD.

@nodev11 what OS are you using? I don't find date -D anwhere...

from alexa-remote-control.

nodev11 avatar nodev11 commented on August 14, 2024

I added a detection for OSX and BSD.

Sadly this doesn't work for me (same errors), so I modified v0.21 (using jq's strptime function again).

@nodev11 what OS are you using? I don't find date -D anwhere...

BusyBox v1.29.2 multi-call binary.

Usage: date [OPTIONS] [+FMT] [TIME]

Display time (using +FMT), or set time

        [-s,--set] TIME Set time to TIME
        -u,--utc        Work in UTC (don't convert to local time)
        -R,--rfc-2822   Output RFC-2822 compliant date string
        -I[SPEC]        Output ISO-8601 compliant date string
                        SPEC='date' (default) for date only,
                        'hours', 'minutes', or 'seconds' for date and
                        time to the indicated precision
        -r,--reference FILE     Display last modification time of FILE
        -d,--date TIME  Display TIME, not 'now'
        -D FMT          Use FMT for -d TIME conversion

Recognized TIME formats:
        hh:mm[:ss]
        [YYYY.]MM.DD-hh:mm[:ss]
        YYYY-MM-DD hh:mm[:ss]
        [[[[[YY]YY]MM]DD]hh]mm[.ss]
        'date TIME' form accepts MMDDhhmm[[YY]YY][.ss] instead

from alexa-remote-control.

adn77 avatar adn77 commented on August 14, 2024

I tried something different now.
In theory we can instruct the shell not to exit on error. Next I simply try all the different date commands we know.

https://raw.githubusercontent.com/adn77/alexa-remote-control/master/alexa_remote_control.sh

If it works, I will PR this later today.

from alexa-remote-control.

nodev11 avatar nodev11 commented on August 14, 2024

https://raw.githubusercontent.com/adn77/alexa-remote-control/master/alexa_remote_control.sh

If it works, I will PR this later today.

Works for me. No errors were thrown. Well done!

from alexa-remote-control.

nodev11 avatar nodev11 commented on August 14, 2024

Problem fixed by adn77
Thanks a lot!

from alexa-remote-control.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.