abbi031892 / periscope

Automatically exported from code.google.com/p/periscope
0 stars 0 forks source link

[enhancement] Support of TVsubtitles.net #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Can you add the support of http://www.tvsubtitles.net/ please ?

Thanks a lot !

Original issue reported on code.google.com by mathieu....@gmail.com on 20 Jan 2010 at 9:44

GoogleCodeExporter commented 8 years ago
Started working on this one

Original comment by patrick....@gmail.com on 11 Feb 2010 at 12:43

GoogleCodeExporter commented 8 years ago
Hi,
I activated the TVSubtitles plugin in the last version of periscope (0.1.9) but 
it 
seems it can't find any subtitle. For XBMC and SickBeard, the folders have this 
structure : /tvshow/Season x/tvshow - sXXeXX - title.avi. Do I miss something ?

Original comment by luc.rina...@gmail.com on 13 May 2010 at 12:05

GoogleCodeExporter commented 8 years ago
TVSubtitles support is still pretty alpha as I'm not really pleased with the 
way it 
works (it's too slow). I will add unit tests for the format used by XBMC and 
SickBeard 
in order to improve TVSubtitles support.

Original comment by patrick....@gmail.com on 13 May 2010 at 4:16

GoogleCodeExporter commented 8 years ago
Hi,

First thanks for periscope, it will be a good companion for my Sickbeard 
install. I see you talk with Sickbeard dev about using periscope python lib in 
Sickbeard.

Second, I take a look to TVSubtitles plugin code, you use a dictionnary/array 
to store tv shows names. I need to add a show to this array, is there a special 
rule to do it ? Or can it add the show to the bottom of the array declaration 
using the higher index available +1 ?
I don't know python very well, but I already code a class used to parse html 
results, tvsubtitles is good website to get french subtitles so I'm really 
interested by this plugin, and I could try to do something more "generic".

Original comment by tec...@gmail.com on 27 Oct 2010 at 9:48

GoogleCodeExporter commented 8 years ago
Hi,

TVSubtitles is not enabled by default because it is not generic enough. If you 
have ideas to make it more generic, feel free to share them. Or better, to 
submit a patch :)

You can add a new show by adding to the array (it's a map to be pythonically 
correct) the name of your show and the ID from TVSubtitles.net
For instance if you wanted to add Stargate Universe, you need to put the ID 
from the URL (544):
http://www.tvsubtitles.net/tvshow-544-2.html

So the map would become :
(...)
"wonderfalls":165,
"stargate universe" : 544
 }
(...)

Original comment by patrick....@gmail.com on 28 Oct 2010 at 7:08

GoogleCodeExporter commented 8 years ago
HI,

Thanks for your answer.
I'm interrested in building a plugin.
I take a quick look at TVSubtitles website structure. It's possible to get the 
show url from the show list page for example, and completing the persistent map 
if the show is not found in a first search from the map. I will try this in the 
next days.
http://www.tvsubtitles.net/tvshows.html

Sorry for my english, It's probably not really understandable ;)

Original comment by tec...@gmail.com on 28 Oct 2010 at 8:24

GoogleCodeExporter commented 8 years ago
Ton anglais est parfaitement compréhensible :)

Si tu as besoin d'aide tu peux me contacter directement par mail (en français) 
sur admin_AT_getmesubs.com

Original comment by patrick....@gmail.com on 29 Oct 2010 at 7:16

GoogleCodeExporter commented 8 years ago
Hi,

I've written a tvsubtitles downloader myself...it's far from perfect, though I 
could propose the attached snippet, which allows updating the available shows 
list. This prevents having to hard-code the list.

Maybe this helps.

Original comment by remi.rer...@gmail.com on 22 Nov 2010 at 5:17

GoogleCodeExporter commented 8 years ago
Strangely, the file I tried to attach doesn't appear, here it is, inlined this 
time:

import urllib2
import re

TVSUBTITLES_URL = 'http://www.tvsubtitles.net'

def lookup_shows():
    """
    Gets the show ids, returns a dict which allows looking up a show's id from
    its name
    """
    # Build the url for the page containing the shows list
    tvshows_url = '%s/tvshows.html' % TVSUBTITLES_URL

    # Build the regex which matches a show entry
    pattern = re.compile('^.*"tvshow-(\d*)-\d*\.html">(.*).*$')

    # Initialize the shows dict
    shows = {}

    # Parse the page and fill in the shows dict with every entry found
    for line in urllib2.urlopen(tvshows_url):
        match = pattern.match(line)
        if match:
            show_id, show_name = match.groups()
            shows[show_name] = int(show_id)

    # Return the shows lookup dict
    return shows

print lookup_shows()

Original comment by remi.rer...@gmail.com on 22 Nov 2010 at 5:23

GoogleCodeExporter commented 8 years ago
Hi, 

I currently do the same, for now i can get the list of shows, inserting them in 
a map, saving it in a file. During a search if the show is not in the map, the 
map will be updated from 'http://www.tvsubtitles.net' and saved in a file, this 
file is loaded for each search. It avoid to use a hard-coded map but do not 
parse the html shows list during each search.
It's almost done, I will test it this week-end, i'm on the move for now.

ps: I could post the additional code here if you want.

Original comment by tec...@gmail.com on 24 Nov 2010 at 8:34

GoogleCodeExporter commented 8 years ago
The easiest would be to put it as a patch. I agree with tecoxe that parsing the 
show list each time would be too much.

I'd gladly take patches and add them to the source.

Original comment by patrick....@gmail.com on 24 Nov 2010 at 8:56

GoogleCodeExporter commented 8 years ago
Hello,

Do you have any news about tvsubtitles support for periscope ?

Thank you

Original comment by gger...@gmail.com on 20 Feb 2012 at 9:48

GoogleCodeExporter commented 8 years ago
Isn't it possible to use code from this project to get TVsubtitles support?

https://github.com/KonishchevDmitry/pysd

Original comment by DarkAnge...@gmail.com on 17 Mar 2012 at 2:48