orivar Wrote:Hello everyone and amet in particular,
First off thanks again for the great addon. I've only recently updated to Dharma/10.0 and while my old skin is lacking proper support (MediaStream Redux) I've been using the new addon with Confluence and find it a valuable feature of XBMC.
I've posted before about adding my own service to for local subtitles and now, after finally completing all the scripts and configuration for the rest of my automated media setup, am getting around to it.
Looking for an API I found several of your posts amet directing people to existing service.py's for reference. I've tried reading a couple of updated service script sources but I'm still having trouble "reverse engineering" your exact interface:
1. It seems like there are two main functions that must be implemented, search_subtitles and download_subtitles. Are there any other mandatory functions (or heaven forbid variables)?
no, thats all you need to use
orivar Wrote:2. What do all the input parameters mean? Specifically, what does rar/set_temp mean and what are their expected types? Same for zip_subs/sub_folder/session_id?
3. I see both of these functions return a tuple of 3 items each. What are their types? It seems like search_subtitles returns: a list (of tuples?), some unknown string and a message (msg) I've yet to see used. download_subtitles is a boolean (which is usually False but I can't see the significance), a language string (is this a known set in XBMC? where can I find it?) and a subtitles file (full path?). I'm unlclear about some of their uses and types.
Code:
search_subtitles( file_original_path, title, tvshow, year, season, episode, set_temp, rar, lang1, lang2, lang3 ):
file_original_path -> original path of the file playing
title -> title of the movie or episode
tvshow -> name of a tv show
year -> year
season -> season
episode -> episode
set_temp -> this is mostly false, only true on http:// streamed movies
rar -> if movie/tvshow is in a rar archive
lang1, lang2, lang3 -> languages
Code:
return subtitles_list, session_id, msg
subtitles_list -> list of subtitles
session_id -> some download sites need same session id for download of teh subtitle
msg -> any msg you would like to display after the search is done
Code:
download_subtitles (subtitles_list, pos, zip_subs, tmp_sub_dir, sub_folder, session_id):
subtitles_list -> same list returned from search function
pos -> clicked position from the GUI list
zip_subs -> zipsubs.zip located in tmp location
tmp_sub_dir -> tmp location ^^
sub_folder -> folder where the sub will be saved
session_id -> session_id fron search function
Code:
return False, language, subs_file
False(or True) -> if downloaded file is archive(zip)
language -> language of the subtitle
subs_file -> this is only used if downloaded file is not archive, we need the absolute path so that we can move it to a desired location
orivar Wrote:4. Are there any expected side effects to these functions besides of course extracting the downloaded file if necessary?
you can pass the msg but other than that, no