Página 6 de 7

Re: problema con SerieHD.org

Publicado: 28 Abr 2016, 12:32
por KodiFilms2
Hi Robalo, Thanks for your help!
I try your code but doesn't work. Give me always an error, maybe i do something wrong? I'm a newbie.

The code of @dentaku65 viewtopic.php?p=31175#p31175
http://pastebin.com/qjsHyHqe

Is working and returning the "episodios" the problem is return only one "season", we are trying to fix that. Watch the logs, Kodi just see there is two or more seasons but don't display, maybe because we think something is missed here

Código: Seleccionar todo

url = "%s?idStagioni=%s&episode=%s?%s" % (url, scrapedseason, scrapedepisode, url)
Thanks for your help and i hope i have write everything correct

Re: problema con SerieHD.org

Publicado: 28 Abr 2016, 13:55
por robalo
Ok, culpa mía, pero que tenemos que aprender a observar e intentar interpretar qué dice el log del error.

Supongo que el error es

Código: Seleccionar todo

  File "................../plugin.video.pelisalacarta/channels/seriehd.py", line xxx, in episodios
    season_url = urlparse.urljoin( url, scrapedseason_url )
NameError: global name 'urlparse' is not defined
 
Se tiene que introducir un "import" más en el archivo .py, "import urlparse"

También es posible que podáis necesitar un 'headers' más amplio. En mi caso sí. También es posible que en las líneas con "scrapertools.cache_page( .... )" tengáis que añadir el 'headers' "scrapertools.cache_page( ...., headers=headres )", en mi caso no hace falta.

Lo he probado con la serie '26', "Elementary" y me muestra todos los episodios (77); 1x01-23, 2x01-24, 3x01-24 y 4x06.

Desde mi punto de vista, creo que siempre es mejor solucionar un problema antes de pasar al siguiente; primero "episodios" y más tarde "findvideos".

Ese script de pastebin es lo primero que probé y los patrones no valen para hacer el scraper de los episodios. Si os marea mucho el ejemplo, lo que yo haría, sería buscar la forma de probar el nuevo método del scraper de "episodios" en el script del pastebin.

Re: problema con SerieHD.org

Publicado: 28 Abr 2016, 14:01
por KodiFilms2
I'm sorry but i'm a total newbie to Python and Kodi addon. So what i can say is probably wrong.
So what we can do? Use and fix your code? Thanks

Edit

I noticed you are using pelisalacarta, i'm using Stream on Demand. I know is a fork of pelisalacarta, but i noticed some structure are different.

Re: problema con SerieHD.org

Publicado: 28 Abr 2016, 16:20
por robalo
KodiFilms2 escribió:I noticed you are using pelisalacarta, i'm using Stream on Demand. I know is a fork of pelisalacarta, but i noticed some structure are different.
Channels and connectors are the same for both. We feed each other. Good ideas are good for both worlds :)
There may be minor exceptions, easy to correct or adapt, in the use of some library.

Re: problema con SerieHD.org

Publicado: 28 Abr 2016, 18:23
por dentaku65
Robalo... you're a master!

your fix works like a charms.
I've just add the multiple sources for the video (in a confused manner), but you solved completely the seasons/episodes cycle :-)

@all folks: this is a very good lesson
https://raw.githubusercontent.com/Zanzi ... seriehd.py

Re: problema con SerieHD.org

Publicado: 28 Abr 2016, 20:08
por KodiFilms2
Yes Robalo has fixed! Sorry my bad, i don't have the good experience to adapt the fix to SerieHD channel.

@Robalo here viewtopic.php?f=36&t=7500 we have discussed about the good Python resource for learning. Can you give to us a suggestion? About good resources? Thanks!

@dentaku65 L'unica cosa che mi rende felice e che avevo immaginato da dove prelevare il codice. Spero di apprendere e di riuscire finalmente a darvi una mano

Re: problema con SerieHD.org

Publicado: 28 Abr 2016, 23:16
por robalo
dentaku65 escribió:I've just add the multiple sources for the video (in a confused manner)
Yes, it is true that findvideos is somewhat confusing and there are episodes that does not show the url of videos such as "Elemetary": 2x17 and 2x18.
I leave a "findvideos" which is a bit less confusing and showing videos that were not displayed before.
They work well with the exception of videomega that I can not play; "CCurlFile :: FillBuffer - Failed: HTTP 403 error returned." Possibly be behind a proxy.

Código: Seleccionar todo

def findvideos(item):
    logger.info("[seriehd1.py] findvideos")
    itemlist = []

    data = scrapertools.cache_page( item.url ).replace('\n', '')

    patron = '<iframe id="iframeVid" width=".+?" height=".+?" src="([^"]+)" allowfullscreen="">'
    url = scrapertools.find_single_match(data, patron)

    if 'hdpass.xyz' in url:
        data = scrapertools.cache_page(url, headers=headers).replace('\n', '').replace('> <', '><')

        patron = '<form method="get" action="">'
        patron+= '<input type="hidden" name="([^"]*)" value="([^"]*)"/>'
        patron+= '<input type="hidden" name="([^"]*)" value="([^"]*)"/>'
        patron+= '<input type="hidden" name="([^"]*)" value="([^"]*)"/>'
        patron+= '<input type="hidden" name="([^"]*)" value="([^"]*)"/>'
        patron+= '<input type="submit" class="[^"]*" name="([^"]*)" value="([^"]*)"/>'
        patron+= '</form>'

        for name1, val1, name2, val2, name3, val3, name4, val4, name5, val5  in re.compile(patron).findall(data):

            get_data = '%s=%s&%s=%s&%s=%s&%s=%s&%s=%s' % (name1, val1, name2, val2, name3, val3, name4, val4, name5, val5)

            tmp_data = scrapertools.cache_page('http://hdpass.xyz/film.php?' + get_data, headers=headers)

            patron = r'<input type="hidden" name="urlEmbed" data-mirror="([^"]+)" id="urlEmbed" value="([^"]+)"/>'

            for media_label, media_url in re.compile(patron).findall(tmp_data):
                media_label=scrapertools.decodeHtmlentities(media_label.replace("hosting","hdload"))

                itemlist.append(
                        Item(channel=__channel__,
                             server=media_label,
                             action="play",
                             title=' - [Player]' if media_label == '' else ' - [Player @%s]' % media_label,
                             url=media_url,
                             folder=False))

    return itemlist
KodiFilms2 escribió:@Robalo here viewtopic.php?f=36&t=7500 we have discussed about the good Python resource for learning. Can you give to us a suggestion? About good resources? Thanks!
It is complicated, it is best to ask without fear in the forum, either to another or to me. Surely, you have some response, also without fear :)

Re: problema con SerieHD.org

Publicado: 29 Abr 2016, 20:25
por dentaku65
Thx robalo... implemented your cleanup code... during this challenge with myself and seriehd I've broke my SD card for the many reboots of RPI :-)

Re: problema con SerieHD.org

Publicado: 29 Abr 2016, 20:45
por zanzibar1982
dentaku65 escribió:Thx robalo... implemented your cleanup code... during this challenge with myself and seriehd I've broke my SD card for the many reboots of RPI :-)
All hail Master robalo, father of code and hardware destroyer!

Re: problema con SerieHD.org

Publicado: 01 May 2016, 23:15
por robalo
:lol: :lol: :lol: It does what it can. They are minor collateral damage. :lol: :lol: :lol: