FayasNoushad/GoFile-Bot

Few others issues identified

Closed this issue · 2 comments

Issue 1:

When remote upload:

/upload http://ipv4.download.thinkbroadband.com/5MB.zip

Bot Return Msg:

name 'requests' is not defined

Might need to define an "import requests"

Issue 2:

When remote upload:

/upload http://ipv4.download.thinkbroadband.com/5MB.zip

Bot Return Msg:
name 'name' is not defined

main.py - Line 90: "with open(name, "wb") as file"

Issue 3:

When Issue 1 & 2 is fixed,

Bot Return Msg:
API Error (Not Vaild JSON Data Received)

I think it have to do with gofile.py, might not have receive the correct response although logs indicate the download link/page.

Logs indicates:

[info] {"status":"ok","data":{"guestToken":"grUiVlrJ2Z44pPCmY3B4c5p4EmNEnY2u","downloadPage":"https://gofile.io/d/wkpU1F","code":"wkpU1F","parentFolder":"fd8caac3-1e6b-415b-958f-f7ec95158c28","fileId":"1e2893ff-5673-4ada-b189-37aa21e9efd9","fileName":"5MB.zip","md5":"b3215c06647bc550406a9c8ccc378756"}}

Issue 4:

Unable to upload normal file. Stuck at processing.

/upload -attached file-

Bot Return Msg:
Processing...

Logs indicates:

'NoneType' object has no attribute 'replace'
File "/workspace/main.py", line 58, in filter
[info] text = update.text.replace("\n", " ")
[info] ^^^^^^^^^^^^^^^^^^^
[info] AttributeError: 'NoneType' object has no attribute 'replace'

Thanks @FayasNoushad for fixing Issue 1 & 2.

For Issue 3, did some debugging.

Debug Solution:
gofile.py - amend Line 29 to include: raise Exception(f"API Error (Not Valid JSON Data Received): {out}")

Bot Return Msg:
Error :- API Error (Not Valid JSON Data Received): % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 3 5120k 0 0 3 192k 0 88842 0:00:59 0:00:02 0:00:57 88842 27 5120k 0 0 27 1408k 0 471k 0:00:10 0:00:02 0:00:08 471k 91 5120k 0 0 91 4672k 0 1116k 0:00:04 0:00:04 --:--:-- 1116k 100 5120k 0 0 100 5120k 0 971k 0:00:05 0:00:05 --:--:-- 971k 100 5120k 100 296 100 5120k 56 971k 0:00:05 0:00:05 --:--:-- 1269k {"status":"ok","data":{"guestToken":"grUiVlrJ2Z44pPCmY3B4c5p4EmNEnY2u","downloadPage":"https://gofile.io/d/wkpU1F","code":"wkpU1F","parentFolder":"fd8caac3-1e6b-415b-958f-f7ec95158c28","fileId":"1e2893ff-5673-4ada-b189-37aa21e9efd9","fileName":"5MB.zip","md5":"b3215c06647bc550406a9c8ccc378756"}}

Solution for Issue 3:

gofile.py - amend Line 27 to include: response = json.loads(out.split('\n')[-1])

Still unable to fix for Issue 4.

Fixed