forked from twinther/xbmcstubs
-
Notifications
You must be signed in to change notification settings - Fork 46
/
xbmc.py
4077 lines (2937 loc) · 96.9 KB
/
xbmc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file is generated from Kodi source code and post-edited
# to correct code style and docstrings formatting.
# License: GPL v.3 <https://www.gnu.org/licenses/gpl-3.0.en.html>
"""
**General functions on Kodi.**
Offers classes and functions that provide information about the media currently
playing and that allow manipulation of the media player (such as starting a new
song). You can also find system information using the functions available in
this library.
"""
from typing import Union, List, Dict, Tuple, Optional
__kodistubs__ = True
DRIVE_NOT_READY = 1
ENGLISH_NAME = 2
ISO_639_1 = 0
ISO_639_2 = 1
LOGDEBUG = 0
LOGERROR = 3
LOGFATAL = 4
LOGINFO = 1
LOGNONE = 5
LOGWARNING = 2
PLAYLIST_MUSIC = 0
PLAYLIST_VIDEO = 1
SERVER_AIRPLAYSERVER = 2
SERVER_EVENTSERVER = 6
SERVER_JSONRPCSERVER = 3
SERVER_UPNPRENDERER = 4
SERVER_UPNPSERVER = 5
SERVER_WEBSERVER = 1
SERVER_ZEROCONF = 7
TRAY_CLOSED_MEDIA_PRESENT = 3
TRAY_CLOSED_NO_MEDIA = 2
TRAY_OPEN = 1
class InfoTagGame:
"""
**Kodi's game info tag class.**
Access and / or modify the game metadata of a ListItem.
@python_v20 New class added.
Example::
...
tag = item.getGameInfoTag()
title = tag.getTitle()
tag.setDeveloper('John Doe')
...
"""
def __init__(self, offscreen: bool = False) -> None:
pass
def getTitle(self) -> str:
"""
Gets the title of the game.
:return: [string] title
@python_v20 New function added.
"""
return ""
def getPlatform(self) -> str:
"""
Gets the platform on which the game is run.
:return: [string] platform
@python_v20 New function added.
"""
return ""
def getGenres(self) -> List[str]:
"""
Gets the genres of the game.
:return: [list] genres
@python_v20 New function added.
"""
return [""]
def getPublisher(self) -> str:
"""
Gets the publisher of the game.
:return: [string] publisher
@python_v20 New function added.
"""
return ""
def getDeveloper(self) -> str:
"""
Gets the developer of the game.
:return: [string] developer
@python_v20 New function added.
"""
return ""
def getOverview(self) -> str:
"""
Gets the overview of the game.
:return: [string] overview
@python_v20 New function added.
"""
return ""
def getYear(self) -> int:
"""
Gets the year in which the game was published.
:return: [integer] year
@python_v20 New function added.
"""
return 0
def getGameClient(self) -> str:
"""
Gets the add-on ID of the game client executing the game.
:return: [string] game client
@python_v20 New function added.
"""
return ""
def setTitle(self, title: str) -> None:
"""
Sets the title of the game.
:param title: string - title.
@python_v20 New function added.
"""
pass
def setPlatform(self, platform: str) -> None:
"""
Sets the platform on which the game is run.
:param platform: string - platform.
@python_v20 New function added.
"""
pass
def setGenres(self, genres: List[str]) -> None:
"""
Sets the genres of the game.
:param genres: list - genres.
@python_v20 New function added.
"""
pass
def setPublisher(self, publisher: str) -> None:
"""
Sets the publisher of the game.
:param publisher: string - publisher.
@python_v20 New function added.
"""
pass
def setDeveloper(self, developer: str) -> None:
"""
Sets the developer of the game.
:param developer: string - title.
@python_v20 New function added.
"""
pass
def setOverview(self, overview: str) -> None:
"""
Sets the overview of the game.
:param overview: string - overview.
@python_v20 New function added.
"""
pass
def setYear(self, year: int) -> None:
"""
Sets the year in which the game was published.
:param year: integer - year.
@python_v20 New function added.
"""
pass
def setGameClient(self, gameClient: str) -> None:
"""
Sets the add-on ID of the game client executing the game.
:param gameClient: string - game client.
@python_v20 New function added.
"""
pass
class InfoTagMusic:
"""
**Kodi's music info tag class.**
Access and / or modify the music metadata of a ListItem.
Example::
...
tag = xbmc.Player().getMusicInfoTag()
title = tag.getTitle()
url = tag.getURL()
...
"""
def __init__(self, offscreen: bool = False) -> None:
pass
def getDbId(self) -> int:
"""
Get identification number of tag in database.
:return: [integer] database id.
@python_v18 New function added.
"""
return 0
def getURL(self) -> str:
"""
Returns url of source as string from music info tag.
:return: [string] Url of source
"""
return ""
def getTitle(self) -> str:
"""
Returns the title from music as string on info tag.
:return: [string] Music title
"""
return ""
def getMediaType(self) -> str:
"""
Get the media type of the music item.
:return: [string] media type
Available strings about media type for music:
====== =============================
String Description
====== =============================
artist If it is defined as an artist
album If it is defined as an album
song If it is defined as a song
====== =============================
@python_v18 New function added.
"""
return ""
def getArtist(self) -> str:
"""
Returns the artist from music as string if present.
:return: [string] Music artist
"""
return ""
def getAlbum(self) -> str:
"""
Returns the album from music tag as string if present.
:return: [string] Music album name
"""
return ""
def getAlbumArtist(self) -> str:
"""
Returns the album artist from music tag as string if present.
:return: [string] Music album artist name
"""
return ""
def getGenre(self) -> str:
"""
Returns the genre name from music tag as string if present.
:return: [string] Genre name
@python_v20 Deprecated. Use **`getGenres()`** instead.
"""
return ""
def getGenres(self) -> List[str]:
"""
Returns the list of genres from music tag if present.
:return: [list]`List` of genres
@python_v20 New function added.
"""
return [""]
def getDuration(self) -> int:
"""
Returns the duration of music as integer from info tag.
:return: [integer] Duration
"""
return 0
def getYear(self) -> int:
"""
Returns the year of music as integer from info tag.
:return: [integer] Year
@python_v20 New function added.
"""
return 0
def getRating(self) -> int:
"""
Returns the scraped rating as integer.
:return: [integer] Rating
"""
return 0
def getUserRating(self) -> int:
"""
Returns the user rating as integer (-1 if not existing)
:return: [integer] User rating
"""
return 0
def getTrack(self) -> int:
"""
Returns the track number (if present) from music info tag as integer.
:return: [integer] Track number
"""
return 0
def getDisc(self) -> int:
"""
Returns the disk number (if present) from music info tag as integer.
:return: [integer] Disc number
"""
return 0
def getReleaseDate(self) -> str:
"""
Returns the release date as string from music info tag (if present).
:return: [string] Release date
"""
return ""
def getListeners(self) -> int:
"""
Returns the listeners as integer from music info tag.
:return: [integer] Listeners
"""
return 0
def getPlayCount(self) -> int:
"""
Returns the number of carried out playbacks.
:return: [integer] Playback count
"""
return 0
def getLastPlayed(self) -> str:
"""
Returns last played time as string from music info tag.
:return: [string] Last played date / time on tag
@python_v20 Deprecated. Use **`getLastPlayedAsW3C()`** instead.
"""
return ""
def getLastPlayedAsW3C(self) -> str:
"""
Returns last played time as string in W3C format (YYYY-MM-DDThh:mm:ssTZD).
:return: [string] Last played datetime (W3C)
@python_v20 New function added.
"""
return ""
def getComment(self) -> str:
"""
Returns comment as string from music info tag.
:return: [string] Comment on tag
"""
return ""
def getLyrics(self) -> str:
"""
Returns a string from lyrics.
:return: [string] Lyrics on tag
"""
return ""
def getMusicBrainzTrackID(self) -> str:
"""
Returns the MusicBrainz Recording ID from music info tag (if present).
:return: [string] MusicBrainz Recording ID
@python_v19 New function added.
"""
return ""
def getMusicBrainzArtistID(self) -> List[str]:
"""
Returns the MusicBrainz Artist IDs from music info tag (if present).
:return: [list] MusicBrainz Artist IDs
@python_v19 New function added.
"""
return [""]
def getMusicBrainzAlbumID(self) -> str:
"""
Returns the MusicBrainz Release ID from music info tag (if present).
:return: [string] MusicBrainz Release ID
@python_v19 New function added.
"""
return ""
def getMusicBrainzReleaseGroupID(self) -> str:
"""
Returns the MusicBrainz Release Group ID from music info tag (if present).
:return: [string] MusicBrainz Release Group ID
@python_v19 New function added.
"""
return ""
def getMusicBrainzAlbumArtistID(self) -> List[str]:
"""
Returns the MusicBrainz Release Artist IDs from music info tag (if present).
:return: [list] MusicBrainz Release Artist IDs
@python_v19 New function added.
"""
return [""]
def setDbId(self, dbId: int, type: str) -> None:
"""
Set the database identifier of the music item.
:param dbId: integer - Database identifier.
:param type: string - Media type of the item.
@python_v20 New function added.
"""
pass
def setURL(self, url: str) -> None:
"""
Set the URL of the music item.
:param url: string - URL.
@python_v20 New function added.
"""
pass
def setMediaType(self, mediaType: str) -> None:
"""
Set the media type of the music item.
:param mediaType: string - Media type.
@python_v20 New function added.
"""
pass
def setTrack(self, track: int) -> None:
"""
Set the track number of the song.
:param track: integer - Track number.
@python_v20 New function added.
"""
pass
def setDisc(self, disc: int) -> None:
"""
Set the disc number of the song.
:param disc: integer - Disc number.
@python_v20 New function added.
"""
pass
def setDuration(self, duration: int) -> None:
"""
Set the duration of the song.
:param duration: integer - Duration in seconds.
@python_v20 New function added.
"""
pass
def setYear(self, year: int) -> None:
"""
Set the year of the music item.
:param year: integer - Year.
@python_v20 New function added.
"""
pass
def setReleaseDate(self, releaseDate: str) -> None:
"""
Set the release date of the music item.
:param releaseDate: string - Release date in ISO8601 format (YYYY, YYYY-MM or YYYY-MM-DD).
@python_v20 New function added.
"""
pass
def setListeners(self, listeners: int) -> None:
"""
Set the number of listeners of the music item.
:param listeners: integer - Number of listeners.
@python_v20 New function added.
"""
pass
def setPlayCount(self, playcount: int) -> None:
"""
Set the playcount of the music item.
:param playcount: integer - Playcount.
@python_v20 New function added.
"""
pass
def setGenres(self, genres: List[str]) -> None:
"""
Set the genres of the music item.
:param genres: list - Genres.
@python_v20 New function added.
"""
pass
def setAlbum(self, album: str) -> None:
"""
Set the album of the music item.
:param album: string - Album.
@python_v20 New function added.
"""
pass
def setArtist(self, artist: str) -> None:
"""
Set the artist(s) of the music item.
:param artist: string - Artist(s).
@python_v20 New function added.
"""
pass
def setAlbumArtist(self, albumArtist: str) -> None:
"""
Set the album artist(s) of the music item.
:param albumArtist: string - Album artist(s).
@python_v20 New function added.
"""
pass
def setTitle(self, title: str) -> None:
"""
Set the title of the music item.
:param title: string - Title.
@python_v20 New function added.
"""
pass
def setRating(self, rating: float) -> None:
"""
Set the rating of the music item.
:param rating: float - Rating.
@python_v20 New function added.
"""
pass
def setUserRating(self, userrating: int) -> None:
"""
Set the user rating of the music item.
:param userrating: integer - User rating.
@python_v20 New function added.
"""
pass
def setLyrics(self, lyrics: str) -> None:
"""
Set the lyrics of the song.
:param lyrics: string - Lyrics.
@python_v20 New function added.
"""
pass
def setLastPlayed(self, lastPlayed: str) -> None:
"""
Set the last played date of the music item.
:param lastPlayed: string - Last played date (YYYY-MM-DD HH:MM:SS).
@python_v20 New function added.
"""
pass
def setMusicBrainzTrackID(self, musicBrainzTrackID: str) -> None:
"""
Set the MusicBrainz track ID of the song.
:param musicBrainzTrackID: string - MusicBrainz track ID.
@python_v20 New function added.
"""
pass
def setMusicBrainzArtistID(self, musicBrainzArtistID: List[str]) -> None:
"""
Set the MusicBrainz artist IDs of the music item.
:param musicBrainzArtistID: list - MusicBrainz artist IDs.
@python_v20 New function added.
"""
pass
def setMusicBrainzAlbumID(self, musicBrainzAlbumID: str) -> None:
"""
Set the MusicBrainz album ID of the music item.
:param musicBrainzAlbumID: string - MusicBrainz album ID.
@python_v20 New function added.
"""
pass
def setMusicBrainzReleaseGroupID(self, musicBrainzReleaseGroupID: str) -> None:
"""
Set the MusicBrainz release group ID of the music item.
:param musicBrainzReleaseGroupID: string - MusicBrainz release group ID.
@python_v20 New function added.
"""
pass
def setMusicBrainzAlbumArtistID(self, musicBrainzAlbumArtistID: List[str]) -> None:
"""
Set the MusicBrainz album artist IDs of the music item.
:param musicBrainzAlbumArtistID: list - MusicBrainz album artist IDs.
@python_v20 New function added.
"""
pass
def setComment(self, comment: str) -> None:
"""
Set the comment of the music item.
:param comment: string - Comment.
@python_v20 New function added.
"""
pass
class InfoTagPicture:
"""
**Kodi's picture info tag class.**
Access and / or modify the picture metadata of a ListItem.
@python_v20 New class added.
Example::
...
tag = item.getPictureInfoTag()
datetime_taken = tag.getDateTimeTaken()
tag.setResolution(1920, 1080)
...
"""
def __init__(self, offscreen: bool = False) -> None:
pass
def getResolution(self) -> str:
"""
Get the resolution of the picture in the format "w x h".
:return: [string] Resolution of the picture in the format "w x h".
@python_v20 New function added.
"""
return ""
def setResolution(self, width: int, height: int) -> None:
"""
Sets the resolution of the picture.
:param width: int - Width of the picture in pixels.
:param height: int - Height of the picture in pixels.
@python_v20 New function added.
"""
pass
def setDateTimeTaken(self, datetimetaken: str) -> None:
"""
Sets the date and time at which the picture was taken in W3C format. The
following formats are supported:
YYYY
YYYY-MM-DD
YYYY-MM-DDThh:mm[TZD]
YYYY-MM-DDThh:mm:ss[TZD] where the timezone (TZD) is always optional and can be
in one of the following formats:
Z (for UTC)
+hh:mm
-hh:mm
:param datetimetaken: string - Date and time at which the picture was taken in W3C format.
@python_v20 New function added.
"""
pass
class InfoTagRadioRDS:
"""
**Kodi's radio RDS info tag class.**
To get radio RDS info tag data of currently played `PVR` radio channel source.
.. note::
Info tag load is only be possible from present player class. Also
is all the data variable from radio channels and not known on
beginning of radio receiving.
Example::
...
tag = xbmc.Player().getRadioRDSInfoTag()
title = tag.getTitle()
artist = tag.getArtist()
...
"""
def __init__(self) -> None:
pass
def getTitle(self) -> str:
"""
Title of the item on the air; i.e. song title.
:return: Title
"""
return ""
def getBand(self) -> str:
"""
Band of the item on air.
:return: Band
"""
return ""
def getArtist(self) -> str:
"""
Artist of the item on air.
:return: Artist
"""
return ""
def getComposer(self) -> str:
"""
Get the Composer of the music.
:return: Composer
"""
return ""
def getConductor(self) -> str:
"""
Get the Conductor of the Band.
:return: Conductor
"""
return ""
def getAlbum(self) -> str:
"""
Album of item on air.
:return: Album name
"""
return ""
def getComment(self) -> str:
"""
Get Comment text from channel.
:return: Comment
"""
return ""
def getAlbumTrackNumber(self) -> int:
"""
Get the album track number of currently sended music.
:return: Track Number
"""
return 0
def getInfoNews(self) -> str:
"""
Get News informations.
:return: News Information
"""
return ""
def getInfoNewsLocal(self) -> str:
"""
Get Local news informations.
:return: Local News Information
"""
return ""
def getInfoSport(self) -> str:
"""
Get Sport informations.
:return: Sport Information
"""
return ""
def getInfoStock(self) -> str:
"""
Get Stock informations.
:return: Stock Information
"""
return ""
def getInfoWeather(self) -> str:
"""
Get Weather informations.
:return: Weather Information
"""
return ""
def getInfoHoroscope(self) -> str:
"""
Get Horoscope informations.
:return: Horoscope Information
"""
return ""
def getInfoCinema(self) -> str:
"""
Get Cinema informations.
:return: Cinema Information
"""
return ""
def getInfoLottery(self) -> str:
"""
Get Lottery informations.
:return: Lottery Information
"""
return ""
def getInfoOther(self) -> str:
"""
Get other informations.
:return: Other Information
"""
return ""
def getEditorialStaff(self) -> str:
"""
Get Editorial Staff names.
:return: Editorial Staff
"""
return ""
def getProgStation(self) -> str:
"""
Name describing station.
:return: Program Station
"""
return ""
def getProgStyle(self) -> str:
"""
The the radio channel style currently used.
:return: Program Style
"""
return ""
def getProgHost(self) -> str:
"""
Host of current radio show.
:return: Program Host
"""