Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ext_id" on the VOD Information always a mismatch. #346

Closed
Zibbp opened this issue Jan 7, 2024 Discussed in #345 · 8 comments · Fixed by #347
Closed

"ext_id" on the VOD Information always a mismatch. #346

Zibbp opened this issue Jan 7, 2024 Discussed in #345 · 8 comments · Fixed by #347
Labels
enhancement New feature or request

Comments

@Zibbp
Copy link
Owner

Zibbp commented Jan 7, 2024

Discussed in #345

Originally posted by CappiSteijns January 7, 2024
Wouldn't count this as an issue because beside archiving and watching on Ganymede I'm using the VOD Information from ganymede to make an index on my website so other people can easily find vods trough playlists I made in Ganymede.

For example: https://lekkerspelenfandom.nl/untitled-2/

But take this VOD information as example:

{
  "id": "85f6251d-99f0-11ee-9e8f-0242ac140003",
  "ext_id": "42114447897",
  "platform": "twitch",
  "type": "live",
  "title": "PETER VS TIMON 2023 🏆",
  "duration": 9534,
  "views": 1,
  "resolution": "best",
  "thumbnail_path": "/vods/lekkerspelen/2023-12-13-42114447897-live-85f6251d-99f0-11ee-9e8f-0242ac140003/42114447897-thumbnail.jpg",
  "web_thumbnail_path": "/vods/lekkerspelen/2023-12-13-42114447897-live-85f6251d-99f0-11ee-9e8f-0242ac140003/42114447897-web_thumbnail.jpg",
  "video_path": "/vods/lekkerspelen/2023-12-13-42114447897-live-85f6251d-99f0-11ee-9e8f-0242ac140003/42114447897-video.mp4",
  "chat_path": "/vods/lekkerspelen/2023-12-13-42114447897-live-85f6251d-99f0-11ee-9e8f-0242ac140003/42114447897-chat.json",
  "chat_video_path": "/vods/lekkerspelen/2023-12-13-42114447897-live-85f6251d-99f0-11ee-9e8f-0242ac140003/42114447897-chat.mp4",
  "info_path": "/vods/lekkerspelen/2023-12-13-42114447897-live-85f6251d-99f0-11ee-9e8f-0242ac140003/42114447897-info.json",
  "folder_name": "2023-12-13-42114447897-live-85f6251d-99f0-11ee-9e8f-0242ac140003",
  "file_name": "42114447897",
  "local_views": 1,
  "streamed_at": "2023-12-13T19:48:01.377099Z",
  "updated_at": "2024-01-07T03:13:33.711539Z",
  "created_at": "2023-12-13T19:48:01.377256Z",
  "edges": {
    "channel": {
      "id": "da865789-421d-445f-8fc2-817fd2446111",
      "ext_id": "52385053",
      "name": "lekkerspelen",
      "display_name": "lekkerspelen",
      "image_path": "/vods/lekkerspelen/profile.png",
      "updated_at": "2023-02-01T10:50:34.954278Z",
      "created_at": "2023-01-22T15:19:14.945367Z",
      "edges": {}
    }
  }
}

You would think the "ext_id" would be the id of the vod? So that would be https://www.twitch.tv/videos/42114447897.
But that doesn't exist, it actually is in this case: https://www.twitch.tv/videos/2003234717.

So I was thinking that maybe twitch changes the "ext_id" when it's going from live to vod?

Probably out of scope for this project but was wondering if there was an fix for this.

@Zibbp
Copy link
Owner Author

Zibbp commented Jan 7, 2024

Twitch has a VOD ID and a live ID which is why they are different. Once the video download is complete, I can attempt to update the Ganymede VOD with the Twitch VOD ID that corresponds with the live stream. This obviously has some catches. The VOD needs to be available immediately so the channel needs to not have the manual vod creation setting enabled (where the channel needs to click a button to publish the vod), and needs vods turned on in general.

If the Ganymede livestream video does get updated with the correct external ID of the VOD then you won't be able to archive the VOD as it technically already exists in Ganymede (the external IDs are the same). Probably not a huge concern as you already have the livestream.

Would this solve your issue?

@Zibbp Zibbp added the enhancement New feature or request label Jan 7, 2024
@CappiSteijns
Copy link

Would this solve your issue?

Yes, sounds good!

If the Ganymede livestream video does get updated with the correct external ID of the VOD then you won't be able to archive the VOD as it technically already exists in Ganymede

For me what won't be a problem at all, as you said, I already have the VOD.

Thank you!

@Zibbp
Copy link
Owner Author

Zibbp commented Jan 7, 2024

Released in https://github.com/Zibbp/ganymede/releases/tag/v2.0.2

@CappiSteijns
Copy link

Released in https://github.com/Zibbp/ganymede/releases/tag/v2.0.2

Thank you! Any way I can force this on existing vods?

@Zibbp
Copy link
Owner Author

Zibbp commented Jan 9, 2024

I've added a task that runs the logic for all channels in #351. It is available using the :main image tag for both the frontend and API images. To execute this, visit Admin > Tasks.

image

@CappiSteijns
Copy link

I've added a task that runs the logic for all channels in #351. It is available using the :main image tag for both the frontend and API images. To execute this, visit Admin > Tasks.

image

Thank you so much! Seems to be working :D

@CappiSteijns
Copy link

I've added a task that runs the logic for all channels in #351. It is available using the :main image tag for both the frontend and API images. To execute this, visit Admin > Tasks.
image

Thank you so much! Seems to be working :D

After a little tinkering with it I found out it only works for the latest ~18 vod's located at the =archives (example: https://www.twitch.tv/lekkerspelen/videos?filter=archives) on a twitch channel.
While all the other vods are located at =all (example https://www.twitch.tv/lekkerspelen/videos?filter=all&sort=time)

Now I noticed that those also have a different vod id...

It does work for the newly added vod's automatically tho so thats good! :)

So would it be possible to have the older live archives also corrected with the right vod id?

@Zibbp
Copy link
Owner Author

Zibbp commented Jan 13, 2024

The API call to Twitch to fetch videos is scoped to only return archive videos https://github.com/Zibbp/ganymede/blob/main/internal/activities/video.go#L1096. My logic behind that is only livestreams would need their ID updated so the only video type that should be searched are archives right? Any video other than an archive likely doesn't have the livestream_id attribute on it that I use to match the live stream to the VOD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants