Skip to content

Instantly share code, notes, and snippets.

@henryjfry
henryjfry / TMDB.py
Last active February 26, 2020 02:27
get show id numbers = TMDB.py
import requests
import xml.etree.ElementTree as ET
import sys
_genreids = {
"Action": 28, "Adventure": 12, "Animation": 16, "Comedy": 35, "Crime": 80, "Documentary": 99, "Drama": 18,
"Family": 10751, "Fantasy": 14, "History": 36, "Horror": 27, "Kids": 10762, "Music": 10402, "Mystery": 9648,
"News": 10763, "Reality": 10764, "Romance": 10749, "Science Fiction": 878, "Sci-Fi & Fantasy": 10765, "Soap": 10766,
"Talk": 10767, "TV Movie": 10770, "Thriller": 53, "War": 10752, "War & Politics": 10768, "Western": 37}
@henryjfry
henryjfry / kodi_sql.py
Last active February 13, 2024 19:49
KODI SQL
https://kodi.wiki/view/List_of_built-in_functions
https://kodi.wiki/view/Databases/MyVideos
https://www.reddit.com/r/Addons4Kodi/comments/c4szk4/next_playlist_next_up_episodes_playlist/
https://henryjfry.github.io/repository.nextup/repo/
import sqlite3
con = sqlite3.connect('/home/osmc/.kodi/userdata/Database/MyVideos116.db')
@henryjfry
henryjfry / container.py
Last active February 17, 2020 09:25
TMDB => Container Alternate routes /home/osmc/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/container.py
###/home/osmc/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/player.py
# return self.play_external(force_dialog=True) # Ask user to select a different player
###/home/osmc/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/container.py
elif self.params.get('info') == 'trakt_collection2':
items = TraktAPI(tmdb='tv', login=True).get_collection2('tv', utils.try_parse_int(self.params.get('page', 1)))
if self.params.get('info') == 'strm_pl':
# xbmc.log(str(xbmc.getInfoLabel('System.CurrentControl')) + 'CONTROL===>OPENINFO', level=xbmc.LOGNOTICE)
# xbmc.executebuiltin('ActivateWindow(busydialognocancel)')
@henryjfry
henryjfry / play_base.py
Created February 18, 2020 17:52
OPENMETA - play_stream route ==> /home/osmc/.kodi/addons/plugin.video.openmeta/resources/lib/play_base.py
###
@plugin.route('/play_stream/<label>')
def play_stream(label):
import sys
import xbmcplugin
import xbmcgui
import os
addon_handle = int(sys.argv[1])
xbmc.log(str(xbmcgui.getCurrentWindowDialogId())+'===>OPENMETA', level=xbmc.LOGNOTICE)
@henryjfry
henryjfry / container.py
Created February 19, 2020 18:40
Playlist/STRM better play command - TMDBHelper => /home/osmc/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/container.py
##kodi-send --action='RunPlugin(plugin://plugin.video.themoviedb.helper?info=play2&amp;type=episode&amp;tmdb_id=95&amp;season=1&amp;episode=1)'
###/home/osmc/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/container.py
if self.params.get('info') == 'play2':
import os
addon_handle = self.handle
xbmc.log(str(xbmcgui.getCurrentWindowDialogId())+'===>TMDBHelper', level=xbmc.LOGNOTICE)
@henryjfry
henryjfry / player.py
Last active May 8, 2020 19:43
TMDB => Play4/get_collection_tv/build_details => /home/osmc/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/player.py
###/home/osmc/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/player.py
def play(self, itemtype, tmdb_id, season=None, episode=None, force_dialog=False):
###########
# Attempt to play local file first
is_local = False
# if self.details and self.itemtype == 'movie':
# is_local = self.playmovie()
# if self.details and self.itemtype == 'episode':
# is_local = self.playepisode()
@henryjfry
henryjfry / Includes_View_52_Posters.xml
Last active May 30, 2020 14:49
skin.arctic.horizon - add clearlogos and make backgrounds more visible
###/home/osmc/.kodi/addons/skin.arctic.horizon/1080i/Includes_Labels.xml: <!--PHIL-->
<variable name="Label_Info_Title">
<!--PHIL-->
<value condition="Control.IsVisible(882)"> </value>
<!--MAKE TITLE BLANK WHEN CLEARLOGO VISIBLE-->
<!--PHIL-->
<value condition="[Container.Content() | Container.Content(playlists)] + String.IsEmpty(ListItem.DBType)">$INFO[System.Time]</value>
<value condition="[String.IsEqual(ListItem.DBType,season) | String.IsEqual(ListItem.DBType,episode)] + !String.IsEmpty(ListItem.TvShowTitle)">$INFO[ListItem.TvShowTitle]</value>
@henryjfry
henryjfry / magnet.py
Created October 19, 2020 19:51
realdebrid api magnet
#!/usr/bin/env python
import requests
import json
import time
import sys
#
#/home/osmc/scripts/magnet.py "magnet:?xt=urn:btih:3e0a8674e7e2dba675c5073455d79b9e89d47955&dn=The.West.Wing.S07.1080p.WEB-DL.AAC2.0.H.264-NTb%5Brartv%5D&tr=http%3A%2F%2Ftracker.trackerfix.com%3A80%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2950&tr=udp%3A%2F%2F9.rarbg.to%3A2900" -s 13
#
@henryjfry
henryjfry / magnet_kodi
Created October 19, 2020 20:05
realdebrid api magnet + kodi integration
#!/usr/bin/env python
import requests
import json
import time
import sys
import base64
kodi_credentials = b'USER:PASSWORD'
kodi_ip = '192.168.0.XX'
kodi_port = '8081'
@henryjfry
henryjfry / kodi_rd_prescrape_playlist.py
Created November 13, 2020 19:31
kodi_rd_prescrape_playlist.py
#!/usr/bin/python
import requests
import json
import time
import sys
import PTN
import re
regex = re.compile('[^a-zA-Z]')