2020-09-09, 19:59
I found the original script interesting and tried to write my own add-on.
My script is scraping a website for videos and builds a dictionary of subfolders with video links. The amount of leveled folders is very different each time, like this:
Category1
--- Date1
------ Video1
------ Video2
--- Date2 and so on...
Category2
--- Subcategory1
------ Date1
--------- Video1
--- Subcategory2
I can't know in advance the entire folder structure which also changes from time to time. I thought about building a nested dictionary and at the end parsing it to build the folder items for the add-on.
The example here only uses one fixed level of folders and videos as sub-items.
Now I've hit quite a road block. I've tried something recursive but can't get it right. Is there an easy way to know at which level the add-on gets called using the query string and build the folder item list of that level?
My script is scraping a website for videos and builds a dictionary of subfolders with video links. The amount of leveled folders is very different each time, like this:
Category1
--- Date1
------ Video1
------ Video2
--- Date2 and so on...
Category2
--- Subcategory1
------ Date1
--------- Video1
--- Subcategory2
I can't know in advance the entire folder structure which also changes from time to time. I thought about building a nested dictionary and at the end parsing it to build the folder items for the add-on.
The example here only uses one fixed level of folders and videos as sub-items.
Now I've hit quite a road block. I've tried something recursive but can't get it right. Is there an easy way to know at which level the add-on gets called using the query string and build the folder item list of that level?