Neocky / pluGET

πŸ“¦ Powerful Package manager which updates plugins & server software for minecraft servers
Apache License 2.0
148 stars 27 forks source link

Problem with dynmap - TypeError: 'NoneType' object is not iterable #82

Open brianmay opened 1 month ago

brianmay commented 1 month ago

Describe the bug Error when trying to check Dynmap for updates.

To Reproduce Steps to reproduce the behavior:

  1. get dynmap
  2. check Dynmap
  3. See error

Expected behavior No error.

Screenshots

I added a print to show the URL it is retreiving:

pluGET >> get dynmap
Searching for dynmap...
Found plugins:
 No.  Name                          Downloads  Description
   1  Dynmap                           984503  Dynamic 'Google Maps' style web maps for your Spigot/Bukkit server
   2  LiveAtlas                         22744  An alternative map UI for Dynmap, Squaremap and Overviewer. Supports
                                               multiple servers in one UI.
   3  Plot2Dynmap                       11813  PlotSquared dynmap extension
   4  EP-Dynmap-Towny                    4835  Dynmap-Towny provides a simple way to add visibility of Towny towns and
                                               nations on Dynmap's maps
   5  Dynmap-Multiserver                 4770  Merge your Dynmap together into one big map
   6  GriefPreventionDynmapSupport       4508  Claim markers on your Dynmap...
   7  JDynmapGriefPrevention             4451  GriefPrevention Addon with Dynmap Support (MC1.4.7 - MC1.19)
   8  Dynmap-Faction3                    4379  Plugin for dynmap to show factions.
   9  dynmap-structures                  3257  Shows your world's structures (such as Villages, Strongholds, and
                                               Pyramids) on Dynmap.
  10  Dynmap-GriefPrevention             3056  Adds GriefPrevention Claims To Dynmap
Select your wanted resource (No.)(0 to exit): 1

 ● Dynmap latest

    Downloaded         file β†’ /home/brian/server_plugins/Dynmap-v3.7-beta-5.jar

'STRG + C' to exit
pluGET >> check Dynmap
get_plugin_file_version endswith .
https://api.spiget.org/v2/search/resources/Dynmap-v7-beta-5.jar?field=name&sort=-downloads
Checking... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━  93% -:--:--Error: Couldn't parse json of webrequest
Traceback (most recent call last):
  File "/home/brian/mc/pluGET/./pluget.py", line 45, in <module>
    handle_input()
  File "/home/brian/mc/pluGET/src/handlers/handle_input.py", line 85, in handle_input
    check_installed_plugins(input_selected_object, input_parameter)
  File "/home/brian/mc/pluGET/src/plugin/plugin_updatechecker.py", line 341, in check_installed_plugins
    plugin_count, plugins_with_udpates = check_update_available_installed_plugins(input_selected_object, config_values)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/brian/mc/pluGET/src/plugin/plugin_updatechecker.py", line 316, in check_update_available_installed_plugins
    plugin_spigot_id = search_plugin_spiget(plugin_file, plugin_file_name, plugin_file_version) # plugin_spigot_id isn't needed
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/brian/mc/pluGET/src/plugin/plugin_updatechecker.py", line 556, in search_plugin_spiget
    for plugin in plugin_list:
TypeError: 'NoneType' object is not iterable
[nix-shell:~/mc/pluGET]$ wget 'https://api.spiget.org/v2/search/resources/Dynmap-v7-beta-5.jar?field=name&sort=-downloads'
--2024-06-15 09:50:22--  https://api.spiget.org/v2/search/resources/Dynmap-v7-beta-5.jar?field=name&sort=-downloads
Resolving api.spiget.org (api.spiget.org)... 2606:4700:20::6819:a28, 2606:4700:20::6819:928, 2606:4700:20::ac43:63e9, ...
Connecting to api.spiget.org (api.spiget.org)|2606:4700:20::6819:a28|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-06-15 09:50:23 ERROR 404: Not Found.

I think the correct URL is:

[nix-shell:~/mc/pluGET]$ wget 'https://api.spiget.org/v2/search/resources/Dynmap?field=name&sort=-downloads'
--2024-06-15 09:50:17--  https://api.spiget.org/v2/search/resources/Dynmap?field=name&sort=-downloads
Resolving api.spiget.org (api.spiget.org)... 2606:4700:20::6819:a28, 2606:4700:20::ac43:63e9, 2606:4700:20::6819:928, ...
Connecting to api.spiget.org (api.spiget.org)|2606:4700:20::6819:a28|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 98200 (96K) [application/json]
Saving to: β€˜Dynmap?field=name&sort=-downloads’

Dynmap?field=name&sort=-downl 100%[================================================>]  95.90K  --.-KB/s    in 0.04s

2024-06-15 09:50:17 (2.16 MB/s) - β€˜Dynmap?field=name&sort=-downloads’ saved [98200/98200]

Desktop (please complete the following information):

brianmay commented 1 month ago

Forgot to say: This is with latest git master version.