tp86 / legimi

Unofficial Legimi ebook downloader for Kindle and Linux
11 stars 0 forks source link

Error when running deviceId #14

Closed jakub-wisniowski closed 8 months ago

jakub-wisniowski commented 8 months ago

Hi, I get the following error when I run lua legimi deviceid <device-id>:

    no field package.preload['http.request']
    no file 'src/http/request.lua'
    no file 'src/http/request/init.lua'
    no file 'lib/http/request/src/http/request.lua'
    no file '.luarocks/share/lua/5.3/http/request.lua'
    no file '/usr/local/share/lua/5.3/http/request.lua'
    no file '/usr/local/share/lua/5.3/http/request/init.lua'
    no file '/usr/local/lib/lua/5.3/http/request.lua'
    no file '/usr/local/lib/lua/5.3/http/request/init.lua'
    no file '/usr/share/lua/5.3/http/request.lua'
    no file '/usr/share/lua/5.3/http/request/init.lua'
    no file './http/request.lua'
    no file './http/request/init.lua'
    no file '.luarocks/lib/lua/5.3/http/request.so'
    no file '/usr/local/lib/lua/5.3/http/request.so'
    no file '/usr/lib/x86_64-linux-gnu/lua/5.3/http/request.so'
    no file '/usr/lib/lua/5.3/http/request.so'
    no file '/usr/local/lib/lua/5.3/loadall.so'
    no file './http/request.so'
    no file '.luarocks/lib/lua/5.3/http.so'
    no file '/usr/local/lib/lua/5.3/http.so'
    no file '/usr/lib/x86_64-linux-gnu/lua/5.3/http.so'
    no file '/usr/lib/lua/5.3/http.so'
    no file '/usr/local/lib/lua/5.3/loadall.so'
    no file './http.so'

I installed the dependecies using luarocks --lua-version 5.3 --tree .luarocks install http and got info:

...
http 0.4-0 is now installed in ~/Projects/legimi/.luarocks (license: MIT)
...

I never used lua before and have no idea how to debug it (internet is not really helpful), do you know how to fix this? I don't see any .lua or .so files in the rocks folder.

Screenshot from 2024-03-02 16-13-26 Screenshot from 2024-03-02 16-12-10

tp86 commented 8 months ago

If I remember correctly, http.so should be under .luarocks/lib/lua/5.3/http.so, please check if it exists. Also make sure your Lua version matches one used during installation (5.3 in your case) and that you're running from main repo directory (path above is relative).

If it still doesn't work, let me know, maybe I'll be able to help. But based on your logs it seems it should work already.

N.B. I have encountered other issues with current version like seeing only few books on the list and not being able to download some books, so I plan to rewrite script in Go, which will hopefully be also easier to install and use.

jakub-wisniowski commented 8 months ago

The only files I have in .luarocks/lib/lua/5.3 are: _cqueues.so, lpeg.so, _openssl.so. I'm running the command from main repo directory. I use Lua v5.3.3

tp86 commented 8 months ago

I have just checked and http should be actually installed into .luarocks/share/lua/5.3/http - it's Lua source package rather than native one - my mistake. You can double-check if you indeed have something in this directory. I did fresh install and don't have such issue.

jakub-wisniowski commented 8 months ago

It was installed in .luarocks/share/lua/5.3/http_0_4_0-http, thanks for your help!