asciinema / asciicast2gif

Generate GIF animations from asciicasts (asciinema recordings)
MIT License
1.21k stars 82 forks source link

Syntax Error? #24

Closed dylanjm closed 7 years ago

dylanjm commented 7 years ago

I have a test gif I am trying to convert to a gif and keep getting this syntax error:

[]$ > ./asciicast2gif https://asciinema.org/a/0KXjcaOGZjHdR9b9Q7pJAFQ7P ~/Desktop/test.gif

==> Loading https://asciinema.org/a/0KXjcaOGZjHdR9b9Q7pJAFQ7P...
/Users/DJM/Misc/asciicast2gif/main.js:568
return new Km(a,wf)}function Mm(a){try{var b=a[0];return b.h?b.h(a):b.call(null,a)}catch(e){if(e instanceof Object)throw b=e,a[6].Qc(),b;throw e;}}function Nm(a,b,e){e=Gm(e,Lm(function(e){a[2]=e;a[1]=b;return Mm(a)}));return k(e)?(a[2]=pc(e),a[1]=b,ck):null}function Om(a,b,e){b=b.ld(0,e,Lm(function(b){a[2]=b;a[1]=3;return Mm(a)}));return k(b)?(a[2]=pc(b),a[1]=3,ck):null}function Pm(a,b){var e=a[6];null!=b&&e.ld(0,b,Lm(function(){return function(){return null}}(e)));e.Qc();return e}
                                                                                                                   ^

SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Ts (/Users/DJM/Misc/asciicast2gif/main.js:1026:410)
    at Function.g [as h] (/Users/DJM/Misc/asciicast2gif/main.js:288:239)
    at /Users/DJM/Misc/asciicast2gif/main.js:572:157
    at Function.e [as c] (/Users/DJM/Misc/asciicast2gif/main.js:310:90)

Any idea what is causing this?

juliasilge commented 7 years ago

I also am getting this error, for an asciicast json I've uploaded. I can successfully convert other people's asciicast json that I've tested, and when I just look at my json, nothing looks crazily wrong to me.

Karloff:asciicast2gif juliasilge$ ./asciicast2gif https://asciinema.org/a/140312.json  ~/Desktop/test.gif
==> Loading https://asciinema.org/a/140312.json...
/Users/juliasilge/Code/asciicast2gif/main.js:568
return new Km(a,wf)}function Mm(a){try{var b=a[0];return b.h?b.h(a):b.call(null,a)}catch(e){if(e instanceof Object)throw b=e,a[6].Qc(),b;throw e;}}function Nm(a,b,e){e=Gm(e,Lm(function(e){a[2]=e;a[1]=b;return Mm(a)}));return k(e)?(a[2]=pc(e),a[1]=b,ek):null}function Om(a,b,e){b=b.ld(0,e,Lm(function(b){a[2]=b;a[1]=3;return Mm(a)}));return k(b)?(a[2]=pc(b),a[1]=3,ek):null}function Pm(a,b){var e=a[6];null!=b&&e.ld(0,b,Lm(function(){return function(){return null}}(e)));e.Qc();return e}
                                                                                                                   ^

SyntaxError: Unexpected token  in JSON at position 0
    at JSON.parse (<anonymous>)
    at Ts (/Users/juliasilge/Code/asciicast2gif/main.js:1026:410)
    at Function.g [as h] (/Users/juliasilge/Code/asciicast2gif/main.js:288:239)
    at /Users/juliasilge/Code/asciicast2gif/main.js:572:157
    at Function.e [as c] (/Users/juliasilge/Code/asciicast2gif/main.js:310:90)
    at Function.b [as c] (/Users/juliasilge/Code/asciicast2gif/main.js:566:136)
    at Em.ld (/Users/juliasilge/Code/asciicast2gif/main.js:560:152)
    at $l (/Users/juliasilge/Code/asciicast2gif/main.js:550:379)
    at Vm (/Users/juliasilge/Code/asciicast2gif/main.js:572:73)
    at IncomingMessage.<anonymous> (/Users/juliasilge/Code/asciicast2gif/main.js:1027:432)
juliasilge commented 7 years ago

I successfully converted that asciicast json to gif by downloading the json and then running it all locally.

tidyeval

ku1ik commented 7 years ago

This seems to be duplicate of #21 (although it was run via Docker there), and it's missing support of 302 redirects.

ku1ik commented 7 years ago

This was actually a lack of Content-Encoding: gzip support. Anyway, it seems to be working now.

juliasilge commented 7 years ago

Yep, works for me. Thanks! 🙌