goodtube4u / goodtube

Loads Youtube videos from different sources. Also removes ads, shorts, etc.
121 stars 8 forks source link

Fix: Add API URL prefix to manifestUrl when it starts with '/' #26

Closed tranphuquy19 closed 4 months ago

tranphuquy19 commented 4 months ago

Changes:

I have updated the code to prepend the API URL (goodTube_api_url) to dashUrl when the dashUrl returned from the Invidious API starts with a slash (/) and does not already include the API URL.

Example Response Snippet:

...
    "subCountText": "24.2M",
    "lengthSeconds": 265,
    "allowRatings": true,
    "rating": 0,
    "isListed": true,
    "liveNow": false,
    "isPostLiveDvr": false,
    "isUpcoming": false,
    "dashUrl": "/api/manifest/dash/id/wGedE8ORGjw",
...
tranphuquy19 commented 4 months ago

This is an interesting update. Do the manifest URLs returned from Invidious sometimes not contain the API (i.e. the entire link)?

I was under the impression that they always did, in which case this would not be required. But I might be mistaken. Can you confirm?

You would think that no Invidious servers would be working if this was the case?

Yes, I can confirm that. I thought that configuring domain: invidious.my-domain.example in the yaml config file would fix this, but it didn't.

Ref: https://github.com/iv-org/invidious/blob/master/config/config.example.yml#L98

goodtube4u commented 4 months ago

Awesome - thank you for the update! This has been merged. You are welcome to make changes to this codebase any time my friend.