Broken Integrate video plugin provided Movies directly into the Kodi database
#61
even more strange kodi calling it's resume pointers 'bookmarks' - i dont see the relation

----

history of using 'bookmarks.json' in my addon stems from my use of matthuisman's addons, 3 of them in fact, he has universal bookmarks across his addons and they are in 'bookmarks.json'

initially i was going to use 'favorites' but when i realized his addons do 'bookmarks' i changed mine and at some point the addon would be capable of automatically scanning in bookmarks created by his addons

that since has lost traction because there is really no more functionality to a context menu 'add bookmark' from his addon and mine being universal and having a context menu 'import to kodi'

if you browse the code you will see references to favorites still remains as well as the scanning for bookmarks.json files even though it isn't used in the current iteration
Reply
#62
I have just completed a major rebuild, pushed it to my live kodi from my dev kodi a few hours ago and everything seems to be solid after some quick final fixes.

link in first post - https://forum.kodi.tv/showthread.php?tid=374003

content should be set as "local information only" at this point but it is not required

if you prefer your content be scraped by a kodi scraper be aware this will not prevent the addon from scraping it, kodi will just rescrape and it will take longer

initial load times are less than impressive but subsequental ones are quite good due to the use of caching
Reply
#63
working on finishing touches for v0.0.4 but i have a couple bugs i am trying to work out first

-----

once i work these out i will provide a new release

pretty much reworking things to improve how they function, universalizing functions into modules, improving data sets

-----

with the way things are going i am considering writing a PHP/SQLite backend to be used with this as a network based library served from a nas or other network appliance

if i do then there are more possibilities and potentially a completely different addon altogether

edit:

refresh flag is not being removed and so the bookmark never gets removed after a performing a Refresh from Kodi

found the cause, working on a fix
Reply
#64
0.0.4a now available - link and changelog on first post https://forum.kodi.tv/showthread.php?tid=374003

improved speed considerably when scanning in items initially, once scanned in the listing is nearly instantaneous as it should be

ive been testing changes for quite some time now on my debian dev machine and my main android setup, no other testing platforms used

it is on track to drop the pre-alpha on the next release and begin alpha phase

-----

i found it is quite possible to integrate backend content providers and link them by using a different id, on this i was able to directly call both disney and hulu api modules from matthuisman without going through the front-end of listing content from kodi

this was done by a slightly hackish method of appending paths to sys.path then "import from lib.api as disneyapi"

the downside, other than being hackish, is that Kodi loses track of what it is doing so if you call the Hulu api, delete it with "del" it does not delete so then when trying to call disney afterwards it is actually still calling Hulu and fails

attempted another method using importlib but it's not working with the relative imports in those addons

the only way to make this work was to physically copy the lib folders to the integrate folder but i do not want to include code from other projects
Reply
#65
i put together an example internal scraper and used The CW as a content source

this will list episodes from a show on TheCW, given the "show slug"

example list of internal data from thecw where the slug would be retrieved  - https://www.cwtv.com/feed/mobileapp/shows?api_version=3

for the example i used The Flash, https://www.cwtv.com/shows/the-flash and as you can see the slug is the end of the url "the-flash"

you would call this from the addon default.py when listing a show's episdes, after line 66 currently

store the slug as an 'id' in bookmarks.json under 'ids', so ids[{'tmdb': 60735, 'thecw': 'the-flash'}]

then after 66 you would simply check if 'thecw' in selected['ids'] and if so, call parseEpsCW(selected['ids']['thecw']) to list the episodes of the flash that are available on The CW

https://paste.kodi.tv/xekoxazole

note - the example should iterate seasons at line 51 but it was an example and the cw only lists 1 season for the-flash so i got lazy out and set it to the first

this would be enough information to load those episodes into kodi, not really full information however, at that point it would be time to call the internal tmdb scraper for extra details


the entire bookmark entry to add the flash to the series list would be only a few lines -


json:
    {
        "label": "The Flash (2014)",
        "path": "plugin://plugin.video.integrate/tvshows/?tmdbid=60735",
        "folder": 1,
        "ids": {
            "tmdb": "60735",
            "thecw": "the-flash",
        }
    }
Reply
#66
This has undergone a rebuild using matt huisman's framework, I am working with his project to add additional support for some things needed by my integrate module.

There has been discussion about bringing this to his framework so his addons will be able to import natively.

No decision has been made on that front but there is an impending release whether standalone or not.

Still some work to be done but it all looks promising ...

UPDATE:

back in the rubbish bin - porting to a new framework has not resolved the underlying issue that Kodi cannot handle as much as i am trying to do - huge memory usage and crashing still present
Reply
#67
(2023-09-29, 22:39)izprtxqkft Wrote: UPDATE:

back in the rubbish bin - porting to a new framework has not resolved the underlying issue that Kodi cannot handle as much as i am trying to do - huge memory usage and crashing still present

thinking about this again recently

had a new idea for the library framework side

if i implement this into a localhost http server i could serve up content as a kodi "HTTP Source"

then kodi could have a source http://localhost:4899/movies which is served from this addon

a proxy mode could just re-list content provided by an addon but could create issues

the other way would be it's own sqlite db that it uses to index "imported content" and list for kodi to scrape

-----

the file listing would be a virtual list of .strm files that are a virtual listing of the content "imported"
when the .strm file is requested from the http server it would just serve up the path/url to the addon that plays it

kodi would handle it as it would any other .strm file, scraping it by a "file name" the addon presents

in this way the addon could serve up a virtual directory of addon based content and kodi would be able to scan it into it's library alongside normal local content

implementation of delete on the server side would be possible to remove indexed entries from it's sqlite db, but not sure if kodi has a delete over an http source so maybe not

-----

proxy mode would just live list the content from an addon and present it as though it were coming from the http server
could be useful if trying to import an in progress tv show with newly airing episodes (i.e. from prime video)

but could easily get overwhelmed if it's overused across too many listings and addons creating a slow experience every time kodi updates the library

-----

edit

further thoughts on this

most addons that would be providing content for this purpose (disney,hulu) are using ISA
if this addon is serving virtual .strm files then those files can contain the necessary #KODIPROP to start the stream directly instead of calling the addon first

and

most addons that would use this already incorporate an http server for local MPD parsing/modifications
adding a simple directory listing to the existing http server would be entirely possible
and AFAIK those http servers are started as kodi service addons so they would be available any time kodi is running
Reply
#68
i put together a super simple socket http server in python to test out this theory

kodi is able to read from and scrape content listed
the http server is pretending to serve up a .strm file and kodi then tries to play the content from the addon it's supposed to

the one thing i had to add specifically was handling of HEAD requests, initially i was just handling GET but kodi uses curl to "stat" an http file, curl in turn issues a HEAD request to the server

other than that just making sure the addon serves up the directory listing in the format nginx uses was enough

i'll probably tinker with this some more then release some PoC code
Reply

Logout Mark Read Team Forum Stats Members Help
Integrate video plugin provided Movies directly into the Kodi database0
This forum uses Lukasz Tkacz MyBB addons.