-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2120 from glensc/PlexGuidProviderYoutube
Feature: Add PlexGuidProviderYoutube provider
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from plextraktsync.plex.PlexGuid import PlexGuid | ||
|
||
|
||
class PlexGuidProviderYoutube: | ||
def __init__(self, guid: PlexGuid): | ||
self.guid = guid | ||
|
||
@property | ||
def id(self): | ||
return self.guid.id.split("|")[1] | ||
|
||
@property | ||
def link(self): | ||
return f"https://www.youtube.com/watch?v={self.id}" | ||
|
||
@property | ||
def title(self): | ||
return f"{self.guid.provider}:{self.guid.type}:{self.id}" |