notnotnotswipez / ModioModNetworker

3 stars 1 forks source link

Deleted (but still subscribed) mods error out the script #3

Closed Xinerki closed 1 year ago

Xinerki commented 1 year ago

This mostly falls on mod.io, but an extra check if mod exists would come in handy to not stall the entire queue and the script altogether.

This random resource named "portal-radio" once existed but is now gone, but it still tries to download it regardless, resulting in a 404 "You do not have access" (not a 403, ikr) error, causing the download queue to get stuck.

image

/games/3809/mods/2380180 API output:

{
    "error": {
        "code": 404,
        "error_ref": 15023,
        "message": "You do not have access to this resource."
    }
}

/me/subscribed API output, isolated to just the mod:

{
            "id": 2380180,
            "game_id": 3809,
            "status": 3,
            "visible": 0,
            "submitted_by": {
                "id": 666,
                "name_id": "guest",
                "username": "Guest",
                "display_name_portal": null,
                "date_online": 1490000000,
                "date_joined": 1490000000,
                "avatar": {
                    "filename": "avatar.png",
                    "original": "https://assets.modcdn.io/images/placeholder/avatar.png",
                    "thumb_50x50": "https://assets.modcdn.io/images/placeholder/avatar_50x50.png",
                    "thumb_100x100": "https://assets.modcdn.io/images/placeholder/avatar_100x100.png"
                },
                "timezone": "",
                "language": "",
                "profile_url": "https://mod.io/u/guest"
            },
            "date_added": 1664896694,
            "date_updated": 1680266269,
            "date_live": 1664896752,
            "maturity_option": 0,
            "community_options": 1,
            "monetisation_options": 0,
            "price": 0,
            "tax": 0,
            "logo": {
                "filename": "unknown9.png",
                "original": "https://image.modcdn.io/mods/7d85/2380180/unknown9.png",
                "thumb_320x180": "https://thumb.modcdn.io/mods/7d85/2380180/crop_320x180/unknown9.png",
                "thumb_640x360": "https://thumb.modcdn.io/mods/7d85/2380180/crop_640x360/unknown9.png",
                "thumb_1280x720": "https://thumb.modcdn.io/mods/7d85/2380180/crop_1280x720/unknown9.png"
            },
            "homepage_url": null,
            "name": "Portal Radio",
            "name_id": "portal-radio",
            "summary": "Adds the Radio from Portal as a Spawnable",
            "description": "<p>May or may not contain other Bonelab Soundtracks.</p>\n<hr><p><img src=\"https://image.modcdn.io/members/a4f8/13762914/profile/tenor.gif\" alt=\"\" width=\"498\" height=\"280\"></p>",
            "description_plaintext": "May or may not contain other Bonelab Soundtracks.\n\n-------------------------\n\n",
            "metadata_blob": null,
            "profile_url": "https://mod.io/g/bonelab/m/portal-radio",
            "media": {
                "youtube": [
                    "https://www.youtube.com/watch?v=aIJYZWZb5W4"
                ],
                "sketchfab": [],
                "images": []
            },
            "modfile": {
                "id": 3008643,
                "mod_id": 2380180,
                "date_added": 1665830685,
                "date_scanned": 1665830784,
                "virus_status": 1,
                "virus_positive": 0,
                "virustotal_hash": null,
                "filesize": 94797914,
                "filesize_uncompressed": 96087511,
                "filehash": {
                    "md5": "d19d2708a5325fa7e8014eb2e3eae978"
                },
                "filename": "krisp.radio.3.zip",
                "version": "Quest 2",
                "changelog": "+ added a song\n+ fixed grips\n+ fixed removal\n+ added Chamber 00 from Portal for roleplay purposes",
                "metadata_blob": null,
                "download": {
                    "binary_url": "https://api.mod.io/v1/games/3809/mods/2380180/files/3008643/download",
                    "date_expires": 1747944928
                },
                "platforms": [
                    {
                        "platform": "android",
                        "status": 1
                    }
                ]
            },
            "platforms": [
                {
                    "platform": "windows",
                    "modfile_live": 3008642
                },
                {
                    "platform": "android",
                    "modfile_live": 3008643
                }
            ],
            "metadata_kvp": [],
            "tags": [
                {
                    "name": "Spawnable",
                    "date_added": 1664896700
                },
                {
                    "name": "Props",
                    "date_added": 1664896700
                }
            ],
            "stats": {
                "mod_id": 2380180,
                "popularity_rank_position": 4681,
                "popularity_rank_total_mods": 5649,
                "downloads_today": 0,
                "downloads_total": 4454,
                "subscribers_total": 300,
                "ratings_total": 31,
                "ratings_positive": 31,
                "ratings_negative": 0,
                "ratings_percentage_positive": 100,
                "ratings_weighted_aggregate": 0.89,
                "ratings_display_text": "Very Positive",
                "date_expires": 1684872075
            }
        },
notnotnotswipez commented 1 year ago

Oh interesting, this is useful. Thank you for providing the API responses, I appreciate it :)

I will most likely have a fix for this next patch

Xinerki commented 1 year ago

hell yeah, awesome mod regardless btw

Xinerki commented 1 year ago

Commit aa3e79b8d29a8b0d8aae85c54079dfc099dfe35a fixed the issue, yay