Release Filename-only Scraper (python)
#16
Scraping to folders is only done with tvshows scraper..after scraping name of show/series or episodes..
Your best approach to sort recordings so that they show in library according to their respective folder is using library node editor plugin..it s working fine for me to group recordings via nodes in mysic videos library..i just renamed music videos library to recordings.
Regarding viewed or not viewed tick..i didnt have that issue..you might need to clean library or reset watched unwatched in library or video view.
Reply
#17
Hi,

after an Update in February 2021 to Kodi 19 the Filename-only Scraper produce Error-Messages. New private .mpg Files will not be scraped into the Library.

I have downgraded Kodi back to 18.7 an the Filename-only Scraper works again bug-free.

Greetings
Curt
Reply
#18
Below is my working 'hacked' code for Filename-only Scraper on KODI 19.

The story:
Likely, someone else could make this work much cleaner with KODI 19...but, from a little research, I was guessing its a Python2->Python3 issue. I have NO experience with Python, and was initially researching why some of my Filenames->Titles were getting truncated...personally, I just need the scraper to put unaltered filename->Title and do nothing else...but, while trying to understand the code, I CLUMSILY got the filename-only Scraper to work on a test KODI 19 install.

Since my rig was throwing AttributeError on line 28..then line 32....
I ultimately:
Edited the the 3 urllib instances in the code (lines 28, 31, 35) to urllib.parse.unquote_plus(params[..........)
Added import urllib.parse in heading
Removed reference to invalid thumbnailimage ListItem attribute on line 32

I have a test KODI.19 install on windows machine (tho all my TV boxes are Android), so it was easy-nuff to edit or swap the installed scrape_filename.py IN metadata.common.filenamescraper folder.....and the scraper seems to work. I haven't tried it on other KODI 19 installs, but my test rig chugged thru 1,000s of files on multiple network shares without errors and I'm getting searchable results (using SmartPlaylists) in what was before just an empty library.

BUT......I can't get my altered zip with edited scrape_filename.py to install (likely some sorta Windows issue I read others having).

IF this works for others, perhaps someone can properly make an installable addon.zip on a linux rig so its much easier to install on TV boxes without keyboards. (I'm still working on it)

Here is my edited code (YMMV):


------------scrape_filename.py----clip here to end --------------
python:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import xbmcplugin,xbmcgui,xbmc,xbmcaddon
import os,sys,urllib,urllib.parse

def get_params():
        param=[]
        paramstring=sys.argv[2]
        if len(paramstring)>=2:
                params=sys.argv[2]
                cleanedparams=params.replace('?','')
                if (params[len(params)-1]=='/'):
                        params=params[0:len(params)-2]
                pairsofparams=cleanedparams.split('&')
                param={}
                for i in range(len(pairsofparams)):
                        splitparams={}
                        splitparams=pairsofparams[i].split('=')
                        if (len(splitparams))==2:
                                param[splitparams[0]]=splitparams[1]
                                
        return param


params=get_params()

action=urllib.parse.unquote(params["action"])

if action == 'find':
    title=urllib.parse.unquote(params["title"])
    liz=xbmcgui.ListItem(title, offscreen=True)
    xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=title, listitem=liz, isFolder=True)
elif action == 'getdetails':
    url=urllib.parse.unquote(params["url"])
    liz=xbmcgui.ListItem(url, offscreen=True)
    liz.setInfo('video',
        {'title': url
        })
    xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=liz)

xbmcplugin.endOfDirectory(int(sys.argv[1]))
Reply
#19
This works for movies but how to to use this with tvshows?
Reply

Logout Mark Read Team Forum Stats Members Help
Filename-only Scraper (python)0