run-task icon indicating copy to clipboard operation
run-task copied to clipboard

Hanger sometime cannot download plugins for Specific platform

Open nicolube opened this issue 1 year ago • 4 comments

Hello there,

I tried to download ViaVersion via Hanger for Velocity but that failed because it fetches from:
https://hangarcdn.papermc.io/plugins/ViaVersion/ViaVersion/versions/5.0.5/VELOCITY/ViaVersion-5.0.5.jar

But thet Download Link for Velocity is:\ https://hangarcdn.papermc.io/plugins/ViaVersion/ViaVersion/versions/5.0.5/PAPER/ViaVersion-5.0.5.jar

See:

curl -X GET "https://hangar.papermc.io/api/v1/projects/ViaVersion/versions/5.0.5" \
 -H 'accept: application/json' 

A solution would be to fetch download url from Versions API...

nicolube avatar Oct 18 '24 03:10 nicolube

This is a problem with the Hangar API, run-tasks usage follows the documentation: https://hangar.papermc.io/api-docs#get-/api/v1/projects/-slug-/versions/-name-/-platform-/download

jpenilla avatar Oct 18 '24 03:10 jpenilla

@jpenilla Download URL Provided via the Version API does not always follow this schma

See VELOCITY section in Result for ViaVersion version 5.0.5
https://hangar.papermc.io/api-docs#get-/api/v1/projects/-slug-/versions/-name-

Id seems for plugins with the same jar for mutible platforms the url is the same... As seen in the downloads section.

{
  "createdAt": "2024-10-15T08:47:31.875072Z",
  "name": "5.0.5",
  "visibility": "public",
  "description": "- Fixed a regression from 5.0.4 where tags weren't updated correctly\n\n### 5.0.4 Changelog:\nOn top of a few smaller fixes, this update also comes with various small performance and memory allocation optimizations\n- Added `hide-scoreboard-numbers` config option to hide scoreboard score numbers in 1.20.2->1.20.3 (by Pablete1234)\n- Added `fix-1_21-placement-rotation` config option to fix slightly behind block placement rotation when turning quickly in 1.20.5->1.21. Disabled by default as it may trigger anticheats (by EnZaXD)\n- Fixed sound id rewriting in custom item instrument and jukebox data in 1.20.5->1.21\n- Fixed bad conversion of can place on/can break in item hover events in 1.20.3->1.20.5 (by EnZaXD)\n- Fixed possible errors with entity equipment in 1.20.3->1.20.5 (by EnZaXD)\n- Added missing written book component handling in newer protocols for nested item data (by EnZaXD)\n- Re-added \"Invalid book tag\" view in 1.20.4->1.20.5 (by EnZaXD)\n- Fixed bossbar issues in 1.8->1.9 (by EnZaXD)\n- Improved 1.8->1.9 sound mappings (by RK_01)\n- Fixed handling of various non-standard data across protocols (by EnZaXD)\n\nIf you want to get larger version updates early, including 1.21.2, consider supporting me via https://viaversion.com/donate. See the [previous update notes](https://github.com/ViaVersion/ViaVersion/releases/tag/4.9.3) for more info.",
  "stats": {
    "totalDownloads": 1862,
    "platformDownloads": {
      "PAPER": 1687,
      "VELOCITY": 175
    }
  },
  "author": "kennytv",
  "reviewState": "reviewed",
  "channel": {
    "createdAt": "2022-12-31T20:04:25.916259Z",
    "name": "Release",
    "description": null,
    "color": "#00E1E1",
    "flags": [
      "PINNED",
      "FROZEN",
      "SENDS_NOTIFICATIONS"
    ]
  },
  "pinnedStatus": "CHANNEL",
  "downloads": {
    "PAPER": {
      "fileInfo": {
        "name": "ViaVersion-5.0.5.jar",
        "sizeBytes": 4827614,
        "sha256Hash": "49753c13c6fcc60321b245cf326770368741dc78063727adfeb12da2a6c20164"
      },
      "externalUrl": null,
      "downloadUrl": "https://hangarcdn.papermc.io/plugins/ViaVersion/ViaVersion/versions/5.0.5/PAPER/ViaVersion-5.0.5.jar"
    },
    "VELOCITY": {
      "fileInfo": {
        "name": "ViaVersion-5.0.5.jar",
        "sizeBytes": 4827614,
        "sha256Hash": "49753c13c6fcc60321b245cf326770368741dc78063727adfeb12da2a6c20164"
      },
      "externalUrl": null,
      "downloadUrl": "https://hangarcdn.papermc.io/plugins/ViaVersion/ViaVersion/versions/5.0.5/PAPER/ViaVersion-5.0.5.jar"
    }
  }
... Dependencies etc...
}

nicolube avatar Oct 19 '24 19:10 nicolube

If I put follow the documentation u send me, I get an 404...

nicolube avatar Oct 19 '24 19:10 nicolube

Yes, this is a bug in the Hangar API. It's already fixed on Hangar staging, just waiting for it to come to prod now.

jpenilla avatar Oct 19 '24 19:10 jpenilla

Fixed by Hangar

jpenilla avatar Nov 11 '24 19:11 jpenilla