Your 2nd Add-On: Online Videos!
#76
Hooray -- it works,

download script.modules.requests-2.22.0.zip and install from zip file

Then add into addon.xml file


<requires>
  <import addon="script.module.requests" version="2.22.0"/>
</requires>

Now add into main.py of the plugin.video.example following snippet


import json
import requests

url = 'http://iptv.server.com/series.json'

VIDEOS = {}
html = requests.get(url)
DATA = json.loads(html.content)
for series in DATA.keys():
    s = series.encode('utf-8')
    #xbmc.log(s, xbmc.LOGNOTICE)
    VIDEOS = []
    for episode in DATA[series]:
        name  = episode['name'].encode('utf-8')
        genre = episode['genre'].encode('utf-8')
        #xbmc.log(name, xbmc.LOGNOTICE)
        #xbmc.log(genre, xbmc.LOGNOTICE)
        e = { "name": name, "thumb": episode["thumb"], "video": episode["video"], "genre": genre }
        VIDEOS[s].append(e)
[/s]
Reply
#77
Hi,

you know an addon to create .strm files ?
Reply
#78
Are you asking for a program example or an add-on specifically for creating .strm files?
Reply
#79
(2020-06-01, 00:26)robertus Wrote: Hi,

you know an addon to create .strm files ?
here is py code for the function from my addon.

strmPath = ('special://profile/addon_data/plugin.video.addon-name/strm_dir/')
if not xbmcvfs.exists(strmPath):
    xbmcvfs.mkdir(strmPath)
strmPath = xbmc.translatePath(strmPath)
...
...
def makeStrm(name,movieurl):

    try:
        fileObj = open((strmPath + str(name).replace(':','-').replace('/','-').replace('?','').replace("'","").replace('\\','_').replace('#', ' ').replace('&','and') +'.strm'),'w')
        fileObj.write(movieurl)
        fileObj.close()
    except:
        pass

/Shooty
Reply
#80
(2020-06-05, 19:16)shooty Wrote:
(2020-06-01, 00:26)robertus Wrote: Hi,

you know an addon to create .strm files ?
here is py code for the function from my addon.

strmPath = ('special://profile/addon_data/plugin.video.addon-name/strm_dir/')
if not xbmcvfs.exists(strmPath):
    xbmcvfs.mkdir(strmPath)
strmPath = xbmc.translatePath(strmPath)
...
...
def makeStrm(name,movieurl):

    try:
        fileObj = open((strmPath + str(name).replace(':','-').replace('/','-').replace('?','').replace("'","").replace('\\','_').replace('#', ' ').replace('&','and') +'.strm'),'w')
        fileObj.write(movieurl)
        fileObj.close()
    except:
        pass

/Shooty
Thanks!
but how can i use it? Sorry but i'm a newbie
Reply
#81
(2020-06-10, 00:12)robertus Wrote:
(2020-06-05, 19:16)shooty Wrote:
(2020-06-01, 00:26)robertus Wrote: Hi,

you know an addon to create .strm files ?
here is py code for the function from my addon.

strmPath = ('special://profile/addon_data/plugin.video.addon-name/strm_dir/')
if not xbmcvfs.exists(strmPath):
    xbmcvfs.mkdir(strmPath)
strmPath = xbmc.translatePath(strmPath)
...
...
def makeStrm(name,movieurl):

    try:
        fileObj = open((strmPath + str(name).replace(':','-').replace('/','-').replace('?','').replace("'","").replace('\\','_').replace('#', ' ').replace('&','and') +'.strm'),'w')
        fileObj.write(movieurl)
        fileObj.close()
    except:
        pass

/Shooty
Thanks!
but how can i use it? Sorry but i'm a newbie
If you just want a program or script, you can see if context.dandy.strm.generator is still available.
Google it.
/Shooty
Reply



Logout Mark Read Team Forum Stats Members Help
Your 2nd Add-On: Online Videos!2
This forum uses Lukasz Tkacz MyBB addons.