Hello bradvido88. I really like the idea of this program, but I'm having a lot of trouble with it. I have been programming for several years, but never in java. I think I could modify some things to make this work for the Youtube addon by TheCollective, but Mainly the Project Free TV addon by Eldarado(XBMChub stuff) But I can't compile your program. I think I need a makefile and "Logger.java"
The Project Free TV addon uses additional info for the folder structure, "PFT/TV Shows/Favourites/American Pickers/Season 1 (12 Episodes, 67 Links)/1. Big Bear", and some times "PFT/TV Shows/Favourites/American Pickers/Season Special (1 Episodes, 11 Links)/Season Special Episode 1"
For the Project Free TV addon I think that in Archiver.java:
Code:
public static boolean getSeriesFromParentFolder(MyLibraryFile video)
{
//the series title comess before this as a folder name
List<String> skipFolders = new ArrayList<String>();//the must match the folder name COMPLETELY. Partial matches wont be skipped
final String optionalYear ="(\\([0-9]+\\)|\\[[0-9]+\\])?";//matches (nnnn) or [nnnn]
skipFolders.add("(Full Episodes|Episodes|Clips|Seasons)");//literal skips
skipFolders.add("((Season|Series|Set|Episodes|Collection) (\\([0-9]+\\)|[0-9]+))"+" ?"+optionalYear);//name + number + optional_space + optional_year
skipFolders.add("S[0-9]+E[0-9]+ - .+");//to skip "S04E01 - Orientation" in this: Netflix/Instant Queue/H/Heroes/Heroes: Season 4/S04E01 - Orientation/S04E11 - Thanksgiving
skipFolders.add(".+: Season [0-9]+");//to skip "Heroes: Season 4" this: Netflix/Instant Queue/H/Heroes/Heroes: Season 4/S04E01 - Orientation/S04E11 - Thanksgiving
skipFolders.add("[0-9]+");//new format used by playon specified season number as single integer folder
skipFolders.add("(Next|Previous) (Page|Section) \\(.+\\)");//HuluBlueCop/Subscriptions/The Office (HD)/Episodes (174)/Next Page (101-174 of 174)/6x12 - Secret Santa (HD)
String series = getParentFolderWithSkips(video.getFullPath().split(com.bradvido.xbmc.util.Constants.DELIM),skipFolders);
if(valid(series))
{
video.setSeries(series);
return true;
}
return false;
}
The regex:
Code:
skipFolders.add("((Season|Series|Set|Episodes|Collection) (\\([0-9]+\\)|[0-9]+))"+" ?"+optionalYear);//name + number + optional_space + optional_year
Could be changed to:
Code:
skipFolders.add("((Season|Series|Set|Episodes|Collection) ([a-zA-Z_\s])*(\\([0-9]+\\)|[0-9]+))"+" ?"+optionalYear+"(\\(.*\\))*");//name + optional_extra_words + number + optional_space + optional_year + optional_parenthese_section
To cover these types of Season folders, "Show/Season 1 (12 Episodes, 67 Links)/Episode"
As for the Youtube addon I don't know if a Parser->Regex is looking at the whole JSON reponse or just one Tag and which one?
The only way I can get the Youtube addon to archive anything is to force_series="[Y]" because there are no "series" names in the JSON other than what can be pulled from the "file" tag for the directory(&channel=adafruit)
Code:
"file" : "plugin://plugin.video.youtube/?path=/root/subscriptions&user_feed=uploads&view_mode=subscriptions_favorites&login=true&channel=adafruit&page=1&",
"filetype" : "directory",
Here's more of the JSON data, for context, with some of the sections removed to keep it short:
Code:
{
"id" : "1",
"jsonrpc" : "2.0",
"result" : {
"files" : [{
"fanart" : "",
"file" : "plugin://plugin.video.youtube/?path=/root/subscriptions&user_feed=uploads&view_mode=subscriptions_favorites&login=true&channel=adafruit&page=1&",
"filetype" : "directory",
"label" : "More results",
"thumbnail" : "image://C%3a%5cUsers%5cTim%5cAppData%5cRoaming%5cXBMC%5caddons%5cplugin.video.youtube%5cthumbnails%5cnext.png/",
"title" : "",
"type" : "unknown"
}, {
"fanart" : "",
"file" : "plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=S9UJF6ui7AE",
"filetype" : "file",
"label" : "Motion-Activated LED Wristband",
"runtime" : 120,
"thumbnail" : "image://http%3a%2f%2fi.ytimg.com%2fvi%2fS9UJF6ui7AE%2f0.jpg/",
"title" : "Motion-Activated LED Wristband",
"type" : "unknown"
}, {
"fanart" : "",
"file" : "plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=CguREqXZA-o",
"filetype" : "file",
"label" : "Shine Activity Monitor Teardown",
"runtime" : 240,
"thumbnail" : "image://http%3a%2f%2fi.ytimg.com%2fvi%2fCguREqXZA-o%2f0.jpg/",
"title" : "Shine Activity Monitor Teardown",
"type" : "unknown"
}, {
"fanart" : "",
"file" : "plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=TkorLkilMKk",
"filetype" : "file",
"label" : "New Products 01/04/2014",
"runtime" : 480,
"thumbnail" : "image://http%3a%2f%2fi.ytimg.com%2fvi%2fTkorLkilMKk%2f0.jpg/",
"title" : "New Products 01/04/2014",
"type" : "unknown"
}
Etc.........................
],
"limits" : {
"end" : 51,
"start" : 0,
"total" : 51
}
}
}
Please help me fix this.
Thank you!