| 26 | |
| 27 | |
| 28 | class CustomSource(Source): |
| 29 | def __init__(self): |
| 30 | super().__init__(name='custom') # Initialising our custom source with the name 'custom'. |
| 31 | |
| 32 | async def load_item(self, client, query: str): |
| 33 | if 'keyword' in query: |
| 34 | # track_metadata = http.get("https://our.provider/api/{}".format(query)) |
| 35 | |
| 36 | track = CustomAudioTrack({ # Create an instance of our CustomAudioTrack. |
| 37 | 'identifier': '27cgqh0VRhVeM61ugTnorD', # Fill it with metadata that we've obtained from our source's provider. |
| 38 | 'isSeekable': True, |
| 39 | 'author': 'DJ Seinfeld', |
| 40 | 'length': 296000, |
| 41 | 'isStream': False, |
| 42 | 'title': 'These Things Will Come To Be', |
| 43 | 'uri': 'https://open.spotify.com/track/27cgqh0VRhVeM61ugTnorD' |
| 44 | }, requester=0) # Init requester with a default value. |
| 45 | return LoadResult(LoadType.TRACK, [track], playlist_info=PlaylistInfo.none()) |
nothing calls this directly
no outgoing calls
no test coverage detected