zaanposni / psaggregator

PietSmiet Aggregator is a web application that aggregates all the videos, streams and additional content from PietSmiet and displays them in a nice overview.
https://pietsmiet.zaanposni.com
GNU General Public License v3.0
9 stars 3 forks source link

Ability to get corresponding youtube/twitch url from a pietsmiet.de video #47

Closed Bluscream closed 2 weeks ago

Bluscream commented 2 weeks ago

I would be awesome if there was a api endpoint that returned a youtube/witch link to the content given as pietsmiet.de slug/url

Example: GET https://pietsmiet.zaanposni.com/api/link?url=https://www.pietsmiet.de/videos/79561-der-stift-muss-es-richten-bau-simulator

{
   "message": "success",
   "results": [
      {
         "site": "youtube",
         "type": "video",
         "channel": "UCqwGaUvq_l0RKszeHhZ5leA",
         "id": "jfy1tTQcm10",
         "url": "https://www.youtube.com/watch?v=jfy1tTQcm10"
      }
   ]
}

and maybe vice-versa (optional)

Example: GET https://pietsmiet.zaanposni.com/api/link?url=https://www.youtube.com/watch?v=F-zqUzn8-Z0

{
   "message": "success",
   "results": [
      {
         "site": "pietsmiet",
         "type": "video",
         "channel": "44-pietstream",
         "id": "79600",
         "url": "https://www.pietsmiet.de/videos/79600-gothic-1-remake-wir-konnten-es-spielen"
      }
   ]
}
zaanposni commented 2 weeks ago

Hi! Thanks for your suggestion. I am already tracking this in #26

Right now my only idea is to match content pieces based on their title since the pietsmiet.de no longer shares the YouTube URL. If you have any other ideas on how to proceed, please let me know. Will have to check how well the title matching works. Most likely it will not work for a good part of the existing videos. There are also some videos that are only on YT or only on pietsmiet.de.

Bluscream commented 2 weeks ago

I mean you are already caching everything, so if you compare title+channel in your cache/db you could return a result. It would only work for recent videos that are still in your cache, but thats atleast a start. If you csnt find a matching video it can just return success false or a empty resukt array

zaanposni commented 2 weeks ago

I have released version 1.10.0 which has a rudimentary implementation of the feature you requested. I am now trying to match YouTube and pietsmiet.de videos as best I can. However, there are some videos that are not easy to match. At the moment I am working by title, but there may be a better method that I am not aware of. Also note that this only works for new videos at the moment. I have not found a reliable way to import historical data.

Changes:

For example: https://pietsmiet.zaanposni.com/api/video/79561 https://pietsmiet.zaanposni.com/api/video/http%3A%2F%2Fptsmt.de%2Fv%2F79561 https://pietsmiet.zaanposni.com/api/video/https%3A%2F%2Fyoutu.be%2Fjfy1tTQcm10

Bluscream commented 2 weeks ago

Thank you well <3 Can you also support youtube long urls by chance? just the "normal" https://www.youtube.com/watch?v=

Are you storing/caching any additional data to the video by chance or only the stuff that's already in the response?

What i'm most interested in are viewcount, likes, (dislikes i will get through https://returnyoutubedislikeapi.com/swagger/index.html#/Votes), subtitles, chapters and amount of comments

I am planning on fetching the chapters and subtitles for a pietsmietde video from it's youtube equivalent if available via https://yt.lemnoslife.com/ and inject that to https://github.com/Bluscream/grayjay-source-pietsmietde and while i have to fetch a youtube video's info anyway i can also just give the user a setting that combines the pietsmiet.de and youtube metrics (likes, views, etc)

zaanposni commented 2 weeks ago

Currently that data is not available. My idea for psaggregator was to offer an API for data that is not already available. But maybe we can discuss options if you have further ideas. Feel free to add me on Discord (zaanposni)

I can make the url filter more flexible. Maybe I have a chance to work on that next weekend, for now please adjust the URL on your side.

Bluscream commented 1 week ago

I managed to get a full OpenAPI spec going for pietsmiet.de :)

https://app.swaggerhub.com/apis-docs/Bluscream-8ee/pietsmiet.de-api/1.0.0