Creating Addons for xbmc4xbox example movie25.com

Post Reply
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

Day 1

Ok Friends!

We will have a addon from a Video Site!
What can we do!
First developing from addons for xbmc is not magic is it learning by doing!

Ok lets start!

I think most of the user have windows installed on your pc!

First install a python Version on you pc (i have installed python 2.4 this is the same what we have on xbmc4xbox!
http://www.python.org/ftp/python/2.4/python-2.4.msi

next we must have a editor like Notpad++
http://download.tuxfamily.org/notepadpl ... taller.exe

i have installed as Internet Browser Qupzilla is very light and fast and you can all do what we want with him!
http://www.qupzilla.com/download

Have you all installed
Ok lets start the magic!

here is the script with what we start

Code: Select all

# This test program is for finding the correct Regular expressions on a page to insert into the plugin template.
# After you have entered the url between the url='here' - use ctrl-v
# Copy the info from the source html and put it between the match=re.compile('here')
# press F5 to run if match is blank close and try again.

import urllib2,urllib,re

mainurl='http://movie25.com/'
url=''

req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('').findall(link)

print response.info()
ok what will it do

import urllib2,urllib,re its import the urllib, urlib2 for url handling on python and re for regularexpression more to this later

mainurl='http://movie25.com/' this say when i write mainurl python understand that this is http://movie25.com/

req = urllib2.Request(url) this say we make a request to a url on moment its do nothing simple why we have not url given a url

urllib2.urlopen(req) this open the url with the requested url and give it the name response

link=response.read() this read the open url

response.close() this close tho open url

match=re.compile('').findall(link) this will re compile the url and search for a given regular expression

print response.info() this read the open url and print the info from it!


Download the script and unzip it to the Desktop!
http://dl.dropbox.com/u/83714583/movie25Index.py

Lets do the Magic with movie25.com

you have all installed (python,notpad++,Qupzilla)

Go with Qupzilla to http://movie25.com/
wihle most site have a different handling for the different categories we start with scraping a letter Site as example the d site ergo click on the d
Letter on the website and ist's open http://movie25.com/movies/d/.

Look on the first movie on this example it is Dark Feed (2013).
ok click the right mouse over Dark Feed (2013) on Qupzilla and open the link on a new tab .
This give a tab with the new url http://movie25.com/movies/dark-feed-2013.html.
with a mouse click over the http://movie25.com/movies/d/ open the pagesource and search on it for movies/dark-feed-2013.html (why most sites acess on the sources the sites seperat).

this give on the page source this:

Code: Select all

<div class="movie_pic"><a href="http://movie25.com/movies/dark-feed-2013.html"><img src="http://i.imgur.com/myYZY04.jpg" width="101" height="150"></a></div>
  <div class="movie_about">
    <div class="movie_about_text">
      <h1><a href="http://movie25.com/movies/dark-feed-2013.html">Dark Feed (2013)</a>
ok this give the url to the link for the movie ,the thunbnail and the name!

Open the the downloade script with idle (this is the standart Editor what come with you installed python).
Put the url http://movie25.com/movies/d/ on url='http://movie25.com/movies/d/ 'on the script.
Pres f5 and its open the python shell with the resonse info from the site!

Code: Select all

Date: Tue, 19 Mar 2013 14:06:58 GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
Last-Modified: Tue, 19 Mar 2013 07:14:21 GMT
ETag: "6570118-dc68-4d841dabaed40"
Accept-Ranges: bytes
Content-Length: 56424
Cache-Control: max-age=300
Expires: Tue, 19 Mar 2013 14:11:58 GMT
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html

>>> 
write link on the open pythonshell and press enter and you see the sources ready to scrap!
ok openFind on the python shell and search for movies/dark-feed-2013.html!

ok this is what we want:

Code: Select all

<div class="movie_pic"><a href="http://movie25.com/movies/dark-feed-2013.html" ><img src="http://i.imgur.com/myYZY04.jpg" width="101" height="150" /></a></div>\n  <div class="movie_about">\n    <div class="movie_about_text">\n      <h1><a href="http://movie25.com/movies/dark-feed-2013.html" >Dark Feed (2013)</a>
ok copy this and paste it to the script :
this is what we have then:

Code: Select all

match=re.compile('<div class="movie_pic"><a href="http://movie25.com/movies/dark-feed-2013.html" ><img src="http://i.imgur.com/myYZY04.jpg" width="101" height="150" /></a></div>\n  <div class="movie_about">\n    <div class="movie_about_text">\n      <h1><a href="http://movie25.com/movies/dark-feed-2013.html" >Dark Feed (2013)</a>').findall(link)




ok we must scrap this with regular expression and we will only have two syntax on basic for it on this Tutorial for better understanding:

(.*?) this will scrap all what is between ()
.*? this scrap it but ignore it for a match

lets do it

Code: Select all

match=re.compile('<div class="movie_pic"><a href="(.*?)" ><img src="(.*?)" width=".*?" height=".*?" /></a></div>\n  <div class="movie_about">\n    <div class="movie_about_text">\n      <h1><a href=".*?" >(.*?)</a>').findall(link)
Ok we have the on this time:

Code: Select all

# This test program is for finding the correct Regular expressions on a page to insert into the plugin template.
# After you have entered the url between the url='here' - use ctrl-v
# Copy the info from the source html and put it between the match=re.compile('here')
# press F5 to run if match is blank close and try again.

import urllib2,urllib,re

mainurl='http://movie25.com/'
url='http://movie25.com/movies/d/'

req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('<div class="movie_pic"><a href="(.*?)" ><img src="(.*?)" width=".*?" height=".*?" /></a></div>\n  <div class="movie_about">\n    <div class="movie_about_text">\n      <h1><a href=".*?" >(.*?)</a>').findall(link)
print response.info()
make a # for print response.info() the# wil ignore the following code on python
and write on the next line print match press F5 this run the code on the Pythonshell

Yeah we have a match but that have not the right structure!

we have a solution on python with 'for ' for this:

ok delet the added print match and add the following code:

Code: Select all

for url,image,name in match:
    print url
    print image
    print name
and run it with F5 on idle!

yeah we have writen a unversial index parser for movie25.com you can it test replace simple the url from the script with the url from New Realeaes or Latest added its will work!

Tomorrow we Put it to xbmc that we have all categories and the links with the cover and the name and the url for the next step to resolve the Movie url

Day 2

ok we have created a unveral indexparser for the movie25.com site !
With this we can all categories access what since on the site but not the search for movie ,the top 9 movies
and Genere !

Today we integrat the search function we make this first with idle and pure python 2.4 without the xbmc python module and then later on the next Days we intgrated on the xbmc4xox addon!

ok lets starting again with open the movie25.com site on Qupzilla!
we see a search field on this we search for the avatar movie
this bring up a newsite on the Browser "http://movie25.com/search.php?key=avatar&submit="

what will that say !
ok we split this url red is the search word !
http://movie25.com/search.php?key=avatar&submit=

ok we do it with python we create a new file with notpad++ on this we write:

Code: Select all

search = avatar   #this declared the word avatar as search 
searchurl = 'http://movie25.com/search.php?key=' + search + '&submit=' #this insert on the splitted url the variable search what is on this example avatar
print searchurl #print full searchurl
save that as movie25search python file you must go to netpad++ language and activate under p python as language for this file!
run it on idle and it print the url what we want.

ok back to Qupzilla with open http://movie25.com/search.php?key=avatar&submit= url
right click on mouse open pagesource on this we search for avatar
we find the following code:

Code: Select all

<div class="movie_pic"><a href="movies/aliens-vs-avatars-2011.html" target="_blank">
                            <img src="http://i1013.photobucket.com/albums/af259/wakmfdy/002/1-107.jpg" width="101" height="150">
                            </a></div>
            <div class="movie_about">
              <div class="movie_about_text">
                <h1><a href="movies/aliens-vs-avatars-2011.html" target="_blank">
                  Aliens vs. Avatars (2011)                  </a>
this is different from your re on themovie25index script and we want a new regex and we make this without idle!

we copy the first line and add a \n for beginning a new line then we add a .*? for the spaces then we add the next line and add again the \n for a new line and the .*? for the space that makes we with all the code line and this is what we then have:

Code: Select all

<div class="movie_pic"><a href="movies/aliens-vs-avatars-2011.html" target="_blank">\n.*?<img src="http://i1013.photobucket.com/albums/af259/wakmfdy/002/1-107.jpg" width="101" height="150">\n.*?</a></div>\n.*?<div class="movie_about">\n.*?<div class="movie_about_text">\n.*?<h1><a href="movies/aliens-vs-avatars-2011.html" target="_blank">\n.*?Aliens vs. Avatars (2011)                 </a>
ok let us declare what we want with (.*?) :

Code: Select all

<div class="movie_pic"><a href="(.*?)" target="_blank">\n.*?<img src="(.*?)" width="101" height="150">\n.*?</a></div>\n.*?<div class="movie_about">\n.*?<div class="movie_about_text">\n.*?<h1><a href="movies/aliens-vs-avatars-2011.html" target="_blank">\n(.*?)</a>
new lets us declare what we not will have and what can since different with .*?:

Code: Select all

<div class="movie_pic"><a href="(.*?)" target="_blank">\n.*? <img src="(.*?)" width=".*?" height=".*?">\n.*? </a></div>\n.*?<div class=".*?">\n.*?<div class=".*?">\n.*?<h1><a href=".*?" target=".*?">\n(.*?)</a>
paste this between match='' on the new search script!
and run it with F5 ok we have a match but the spaces on the name since bad

we have a solution with replace on python :

name=name.replace(' ', '')
ok that say we declare name is name and we replace the spaces ' ' with nothing '' on name
ok lets run again and we have what we want

here ist the full movie25 search script as code :

Code: Select all

import urllib2,urllib,re

search = 'avatar'   #this declared the word avatar as search &submit=
url = 'http://movie25.com/search.php?key=' + search + '&submit=' #this split the url and give the variable search to it
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('<div class="movie_pic"><a href="(.*?)" target="_blank">\n.*? <img src="(.*?)" width=".*?" height=".*?" />\n.*?</a></div>\n.*?<div class=".*?">\n.*?<div class=".*?">\n.*?<h1><a href=".*?" target=".*?">\n(.*?)</a>').findall(link)
for url,image,name in match:
    name=name.replace(' ', '')
    print url
    print image
    print name
Day 3 ( we create the Genre script for movie25.com )


ok what we want is again a regex a regex for access the genre !

Ok lets doing we go to the movie25.com Site with Qupzilla and open the Genre Site from it the url is http://movie25.com/genres.html we making a rightMouse click and open the Page source on this we look for the name from the first Genre!
This is that Genre Action:

ok on the Pagesource we find that:

<li><a href="/movies/action/">Action</a></li> #this is very nice we must not open the link Source on the pythonshell we can make the regex for it without!

what we want is blue:
<li><a href="/movies/action/">Action</a></li>

the regex is than:

<li><a href="(.*?)"></a>(.*?)</li>

but that give more result as we want , the result from the regex match is this:

Home
http://movie25.com/movies/new-releases/
New Releases
http://movie25.com/movies/latest-added/
Latest Added
http://movie25.com/movies/featured-movies/
Featured Movies
http://movie25.com/movies/dvd-releases/
DVD Releases
http://movie25.com/movies/most-viewed/
Most Viewed
http://movie25.com/genres.html
Genres
http://movie25.com/play/" target="_blank
Watch Any Movie
/movies/action/
Action
/movies/adventure/
Adventure and more

we look what is different to this what we want:

and we come to the new working regex

<li><a href="/movies/(.*?)">(.*?)</a></li>


this bring as result only the Genre Url and the Name for it and this is what we wanted
we must only add to url result the main url 'http://movie25.com' and '/movies/' to have the right url result lets doing:

Code: Select all

url='action/'
url='http://movie25.com'+ '/movies/'+url
print url
the result is the full url what we want

http://movie25.com/movies/action/

ok we make a script for this :

Code: Select all

import urllib2
import re 
 
url='http://movie25.com/genres.html'
 
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('<li><a href="/movies/(.*?)">(.*?)</a></li>').findall(link)
for url,name in match:
url = 'http://movie25.com'+ '/movies/'+url
	print url
	print name
	
lets run this on Idle with F5 and its bring the right url and name for the genres


Day 4

We make a regexexpression for A-Z Genre


Ok let's start!

When we have a look on the A-Z and 0-9 Genre and we found on the Page sources this:

Code: Select all

<h2>Movie Title&nbsp;</h2>
        <a href="http://movie25.com/movies/0-9">0-9</a> <a href="http://movie25.com/movies/a" >A</a> <a href="http://movie25.com/movies/b" >B</a> <a href="http://movie25.com/movies/c" >C</a> <a href="http://movie25.com/movies/d" >D</a> <a href="http://movie25.com/movies/e" >E</a> <a href="http://movie25.com/movies/f" >F</a> <a href="http://movie25.com/movies/g" >G</a> <a href="http://movie25.com/movies/h" >H</a> <a href="http://movie25.com/movies/i" >I</a> <a href="http://movie25.com/movies/j" >J</a> <a href="http://movie25.com/movies/k" >K</a> <a href="http://movie25.com/movies/l" >L</a> <a href="http://movie25.com/movies/m" >M</a> <a href="http://movie25.com/movies/n" >N</a> <a href="http://movie25.com/movies/o" >O</a> <a href="http://movie25.com/movies/p" >P</a> <a href="http://movie25.com/movies/q" >Q</a> <a href="http://movie25.com/movies/r" >R</a> <a href="http://movie25.com/movies/s" >S</a> <a href="http://movie25.com/movies/t" >T</a> <a href="http://movie25.com/movies/u" >U</a> <a href="http://movie25.com/movies/v" >V</a> <a href="http://movie25.com/movies/w" >W</a> <a href="http://movie25.com/movies/x" >X</a> <a href="http://movie25.com/movies/y" >Y</a> <a href="http://movie25.com/movies/z" >Z</a></div>

we make one script for the 0-9 and A-Z section but a little bit different as the other regex before:

we search with closing breakless and with regexmeta what i mean!


first we make the regex for the 0-9 section with meta the regex meta [ ]

what can this do thats can help:

it declare a new character groups for work with him she can hold any character what you want !
As example this search for [0-9]

ok this is what we want to find with the regex :

http://movie25.com/movies/0-9">0-9

we do this with this code :

http://movie25.com/movies/([0-9]-[0-9]

you can see we have no <a on begin or </a>

we search bettween what we want with :

(http://movie25.com/movies/([0-9]-[0-9]))

this mean we search for http:://movie25.com/movies/ and with a search on the search for a declarecd charactergroup from [0-9] follow from character group [0-9] what this mean ([0-9]-[0-9])!

the working code is than :

Number=re.compile('(http://movie25.com/movies/([0-9]-[0-9]))').findall(link)

ok lets do again for a-z genre:

we have as example <a href="http://movie25.com/movies/c" >C</a>
and we make it again without <a href=" " >C</a> this.

we ope a search ( on this search we search for http://movie25.com/movies/ follow from a decared charactergroup from [a-z] and ") follow with .*? for the " what not can work with this regex follow fom a search on the search with a declared charactergroup from ([A-Z]) and this it is is find that what we want!

full search code Letter is than :

Letter=re.compile('(http://movie25.com/movies/[a-z]").*?([A-Z])').findall(link)


ok we want not search for this on different scripts and we want on the plugin view this later as one addDir (tommorow more to xbmc python syntax addDir)

what will we do..........

import urllib2,re # import der urllib and regularexpression python module
req = urllib2.Request(url) # we declare a variable req what request the giving url with the urllib2 module
response = urllib2.urlopen(req) # we decared a variiable response what open the url with req
link=response.read() # we declare a variable link what read the open url
response.close() # we close the open url

Letter=re.compile('(http://movie25.com/movies/[a-z]").*?([A-Z])').findall(link) #we search for Letter genre
Number=re.compile('(http://movie25.com/movies/([0-9]-[0-9]))').findall(link) # we search for the Letter Genre
match= Number + Letter #we declare match what is Number + Letter
for url,name in match: # we declare with for the first and secund name on match
url=url.replace('"', '') # we replace on the given url's "
print url # we print the url from all what we found
print name # we print the name from all what we found

This is for Today tommorrow we create the Vdeolinks and then we make a little break and make a working movie25.com search addon with cover from the movies and playing the movies!


code for the 0-9 and a-z Genre

Code: Select all

import urllib2,urllib,re

url='http://movie25.com'

req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
print response.info()
Letter=re.compile('(http://movie25.com/movies/[a-z]").*?([A-Z])').findall(link)
Number=re.compile('(http://movie25.com/movies/([0-9]-[0-9]))').findall(link)
match= Number + Letter
for url,name in match:
    url=url.replace('"', '')
    print url
    print name
Day 5 we create the videolink and resolvehosterlink script

ok we have all what we want for a movie 25.com addon for the categories
the only what we not have is top 9 we want is not why the futered video give the same but not only 9 results!


today we create the videolink (regex) and switch than to make a full working movie25.com search addon!

Ok lets go with the Qupzilla browser to the movie25.com site.
the first movie what we see is " Olympus Has Fallen (2013)"
we click on it its open the new Site calling ' http://movie25.com/movies/olympus-has-fallen-2013.html'
we scroll a little bit down and see the first Hoster what is for this movie is 'putlocker'
ok we open with the pagesource from this site and search putlocker :
we found this:

<li class=link_name>putlocker</li><li class="playing_button"><span><a href=http://movie25.com/watch-olympus-has-fallen-660165.html target="_blank">Full Movie</a></span><font id="edit_660165"></font></li>

ok we see its give not a direct link to the hoster only different links for the hoster from this video!

sharerepo have this link:

<li class=link_name>sharerepo</li><li class="playing_button"><span><a href=http://movie25.com/watch-olympus-has-fallen-660166.html target="_blank">Full Movie</a></span><font id="edit_660166"></font></li>

lets to the magic with a regex:

<li class=link_name>(.*?)</li><li class=".*?"><span><a href=(.*?) target="_blank">Full Movie</a></span><font id=".*?"></font></li>

i think where have read the posts before fom Da1 to Day4 can understand

ok we make a liitle script to test this on python:

Code: Select all

import urllib2,re
 
 url='http://movie25.com/movies/olympus-has-fallen-2013.html'
 
 req = urllib2.Request(url)
 req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
 response = urllib2.urlopen(req)
 link=response.read()
 response.close()
 match=re.compile('<li class=link_name>(.*?)</li><li class=".*?"><span><a href=(.*?) target="_blank">Full Movie</a></span><font id=".*?"></font></li>').findall(link)
 for name,url in match:
   print name
   print url


short test its works but we have with this not the linlk wath we want to access the video url!

ok we open Qupzilla with the putlocker url for this movie " http://movie25.com/watch-olympus-has-fallen-660165.html"
and search on the pagesources for this page for putlocker what we found is this:

onclick=\"Javascript:location.href=\'http://www.putlocker.com/file/A780CC553B487613'\" /

ok we want only the url from this lets do with re (regex)like the regex on Day3!
"Javascript:location.href=\'http://www.putlocker.com/file/A780CC553B487613'\"
ok lets do "Javascript.*\http\://www.(.*).\" this search for a Javascript following from .* :location.href= what we not want to have see on your regex following
from
\http\://www. this read over any http:www. we can is simple later pass to the url with + following from (.*) what give on the search the putlocker.com/file/A780CC553B487613
following from the Regex Meta . for the ' following from the last two charakter on the search line \"

ok lets test

Code: Select all

import urllib2,re

url='http://movie25.com/watch-olympus-has-fallen-660165.html'

req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('"Javascript.*\http\://www.(.*).\"').findall(link)
for url in match:
    url = 'http://www.' + url
    print url

oops that bring us the result

putlocker.com/file/A780CC553B487613'\" /

but we want only putlocker.com/file/A780CC553B487613

we fix this without the replace function with on comand:

when we will change a string from the first or the last charackter we can it change on our script with this url = url[:-5]

what will that do:
its say we have a value what is the url value but without the last 5 charakter
the sytnax for this nice future is [value from the first character : - from the last character]
as example a [5:-5]
will bring following result:
cker.com/file/A780CC553B487613
its cut the first five and the last five character from a string.

ok the full working resolvehosterlink script is:

Code: Select all

import urllib2,re

url='http://movie25.com/watch-olympus-has-fallen-660165.html'

req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('"Javascript.*\http\://www.(.*).\"').findall(link)
for url in match:
    url = 'http://www.' + url
    url = url[:-5]
    print url



on this moment we have all what we want to break a little and create a working movie25.com xbmc4xbox search addon!


DAY SIX we create a full working movie25.com search script :

What we want is following :

the scripts from this Tutorial a editor like notpad+ and a little bit time!
on notpad--please install over pluginmanager ''python ident' that we have a full working python editor!

First check if you have the scriptmodule urlresolver installed on your xbox , when you have installed [removed] it is a dependencies and come with the installation from the xbmc4xbox repo from default!
When you have it not installed , go on your xbmc4xbox to the addon4xbox installer install from xbmc4xbox repo under scriptmodule the scriptmodule urlresolver!

What will that scriptmodule do !
The idea for this module is that you have on way to access different Hoster sites and you must not implementes a code on your addon for example for the Hoster putlocker to acces the stream from it on your addon
you must only have the link for the movie or video and with a import from scriptmodule.urlresolver and a little bit speific code you can access the streams!
With the tommo.common module exist a scriptmodule what bring a lot from new or lighter code syntax to developing addons that is very nice but i think not right to understand on the first time!

with our scripts from the tutorial and a Python Gui programm like PyQt we can make a porogram from our code on any platform!
Okay we must the integrate the hoster seperatly on a own script then the scriptmodule urlresolver works only under xbmc!

its give different methodics to write a addon for xbmc over the standart way what we do, over the scriptmodule tommo.common with urlresolver what say its is a urlresolver addon over the scriptmodule xbmcswift what its from my think the modern solution to code for xbmc, over xstream what give complete solution and you can integrate your own sites as example movie25.com and you have all under the addon or last the the way from the sportsdevil or videodevil addon !


ok i give a download link to a standard template for creating addons and say what this code mean and we is the syntax !

http://dl.dropbox.com/u/83714583/Plugin%20Template.py

lets begin:

Code: Select all

import urllib,urllib2,re,xbmcplugin,xbmcgui        #this import the module what we want on this addon 
import xbmc
import urlresolver

pluginhandle = int(sys.argv[1])                        # look here to understand http://stackoverflow.com/questions/4117530/sys-argv1-meaning-in-script


the code for your own addon put here!


def get_params():                                                                         # defined the get par´ams is a must to have on a standart addon template ant i think we com to the function later!
        param=[]
        paramstring=sys.argv[2]
        if len(paramstring)>=2:
                params=sys.argv[2]
                cleanedparams=params.replace('?','')
                if (params[len(params)-1]=='/'):
                        params=params[0:len(params)-2]
                pairsofparams=cleanedparams.split('&')
                param={}
                for i in range(len(pairsofparams)):
                        splitparams={}
                        splitparams=pairsofparams[i].split('=')
                        if (len(splitparams))==2:
                                param[splitparams[0]]=splitparams[1]
                                
        return param




def addLink(name,url,iconimage):                                                                                                        # create the function  addlink  its a must to have on your addon template
        ok=True
        liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)                   
        liz.setInfo( type="Video", infoLabels={ "Title": name } )                                                                   # for a music addon we must change the type
        liz.setProperty('IsPlayable','true')                                                                                                    #say when the list item is playable as example a mp3 file the value true lets it play
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
        return ok


def addDir(name,url,mode,iconimage):
        u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)                             #create addDir its a must to have on a standart addon template
        ok=True
        liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
        liz.setInfo( type="Video", infoLabels={ "Title": name } )                                                                                                      #for a music addon we must change the type
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
        return ok
        
              
params=get_params()
url=None
name=None
mode=None

try:
        url=urllib.unquote_plus(params["url"])
except:
        pass
try:
        name=urllib.unquote_plus(params["name"])
except:
        pass
try:
        mode=int(params["mode"])
except:
        pass

print "Mode: "+str(mode)
print "URL: "+str(url)
print "Name: "+str(name)

if mode==None or url==None or len(url)<1:                            #defined the mode for the different function what we have declared with def on this #example the mode since given for the movie 25.comSearch addon
        print ""
        MovieSearch(url)      

elif mode==1:
        print ""+url
        Index(url)
        
elif mode==2:
        print ""+url
        VIDEOLINKS(url,name)
		

elif mode==3:
        print ""+url
        playVid(url)
       
		



xbmcplugin.endOfDirectory(int(sys.argv[1]))			
more to the xmc modules here :

xbmc http://passion-xbmc.org/gros_fichiers/X ... /xbmc.html
xbmcgui http://passion-xbmc.org/gros_fichiers/X ... mcgui.html
xbmcplugin http://passion-xbmc.org/gros_fichiers/X ... lugin.html


On this moment when you have installed the python ident plugin on notpfad ++ and you have all scripts from this turorial we can Begin


1) on all scripts from this Tutorial we have ever the same code to tor open and acces the url this is nice on the testings script but not nice for a addon !

what can we do :
we creating a function this is a better solution as the same code overall on the addon and we can she access over the name!
Lets doing!

Code: Select all

def getUrl(url):
        req = urllib2.Request(url)
        req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20100101 Firefox/16.0')
        response = urllib2.urlopen(req)
        link=response.read()
        response.close()
        return link
def getUrl(url): this create a funktion with the name getUrl with the attribut url
the folloing code have cleared on the Days before!
on the rest from the addon code we given Function what we have created to a variable with name content ---- content = getUrl(url)
we must than change the syntax on your match from findall(link) to findall(content)


2) we want a Solution tho access the xbmc Keyboard!

i give it here a:

Code: Select all

def search():
        search_entered = ''
        keyboard = xbmc.Keyboard(search_entered, 'Search Movies on Movies25.com')
        keyboard.doModal()
        if keyboard.isConfirmed():
            search_entered = keyboard.getText() .replace(' ','+')  
            if search_entered == None:
                return False          
        return search_entered		
def search(): declared a funktion search with nothing on it ()
keyboard = xbmc.Keyboard(search_entered, 'Search Movies on Movies25.com') give the keboard search the name what you can see when its
open

search_entered = keyboard.getText() .replace(' ','+') sometimes you need to replace spaces with + or %20
if search_entered == None: when you nothing writes give nothing back
return False

return search_entered give back what you write



Ok we create the the def MovieSearch(url)

Code: Select all

def MovieSearch(url):
    search_entered =search()
    name=str(search_entered).replace('+','')
    url='http://movie25.com/search.php?key=' + search_entered + '&submit='
    content = getUrl(url)
    match=re.compile('<div class="movie_pic"><a href="(.*?)" target="_blank">\n.*? <img src="(.*?)" width=".*?" height=".*?" />\n.*?</a></div>\n.*?<div class=".*?">\n.*?<div class=".*?">\n.*?<h1><a href=".*?" target=".*?">\n(.*?)</a>').findall(content)
    for url,thumbnail,name in match:
        name=name.replace(' ', '')
        url='http://movie25.com/'+url
        addDir(name,url,1,thumbnail)
def MovieSearch(url): declared the function with the name MovieSearch and the attribut url
search_entered =search() declared that the variable search_entered is the function search()
name = create a new variable ith the name namestrdeclared the following as string and .replace('+','')
replace the + without that we must write on a search star+wars not we we do star wars
next is the code from the search script from day before only different the url access is working over the declared function getUrl(url)
and on the match= line is not findall(link) its findall(content)

addDir(name,url,1,thumbnail)[/code] this declared a directory what hold the variable name , the variable url , its change to mode 1, and hold the variable thumbnail!
ist give this to mode 1 look on the template and you find mode 1 is VIDEOLINKS(url,name)

this is what you want to understand to create a own addon for xbmc4xbox!

the code above is self cleared and its the full working code :

Code: Select all

import urllib,urllib2,re,xbmcplugin,xbmcgui
import xbmc
import urlresolver
pluginhandle = int(sys.argv[1])



def MovieSearch(url):
    search_entered =search()
    name=str(search_entered).replace('+','')
    url='http://movie25.com/search.php?key=' + search_entered + '&submit='
    content = getUrl(url)
    match=re.compile('<div class="movie_pic"><a href="(.*?)" target="_blank">\n.*? <img src="(.*?)" width=".*?" height=".*?" />\n.*?</a></div>\n.*?<div class=".*?">\n.*?<div class=".*?">\n.*?<h1><a href=".*?" target=".*?">\n(.*?)</a>').findall(content)
    for url,thumbnail,name in match:
        name=name.replace(' ', '')
        url='http://movie25.com/'+url
        addDir(name,url,1,thumbnail)
		
def search():
        search_entered = ''
        keyboard = xbmc.Keyboard(search_entered, 'Search Movies on Movies25.com')
        keyboard.doModal()
        if keyboard.isConfirmed():
            search_entered = keyboard.getText() .replace(' ','+')  # sometimes you need to replace spaces with + or %20
            if search_entered == None:
                return False          
        return search_entered		
		

def VIDEOLINKS(url,name):
        content = getUrl(url)
        match=re.compile('<li class=link_name>(.*?)</li><li class=".*?"><span><a href=(.*?) target="_blank">Full Movie</a></span><font id=".*?"></font></li>').findall(content)
        for name,url in match:
          addDir(name,url,2,"")
        
		  


def playVid(url):
        content = getUrl(url)
        match1=re.compile('"Javascript.*\http\://www.(.*).\"').findall(content)
        for url in match1:
          url = 'http://www.' + url
          url = url[:-5]
          url = url
          hostUrl = url
          videoLink = urlresolver.resolve(hostUrl)
          addLink(name,url,'')
          xbmc.Player().play(videoLink)
         
          
          		  


def getUrl(url):
        req = urllib2.Request(url)
        req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20100101 Firefox/16.0')
        response = urllib2.urlopen(req)
        link=response.read()
        response.close()
        return link
		
		
		
	
def get_params():
        param=[]
        paramstring=sys.argv[2]
        if len(paramstring)>=2:
                params=sys.argv[2]
                cleanedparams=params.replace('?','')
                if (params[len(params)-1]=='/'):
                        params=params[0:len(params)-2]
                pairsofparams=cleanedparams.split('&')
                param={}
                for i in range(len(pairsofparams)):
                        splitparams={}
                        splitparams=pairsofparams[i].split('=')
                        if (len(splitparams))==2:
                                param[splitparams[0]]=splitparams[1]
                                
        return param




def addLink(name,url,iconimage):
        ok=True
        liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
        liz.setInfo( type="Video", infoLabels={ "Title": name } )
        liz.setProperty('IsPlayable','true')
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
        return ok


def addDir(name,url,mode,iconimage):
        u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
        ok=True
        liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
        liz.setInfo( type="Video", infoLabels={ "Title": name } )
        #liz.setProperty('fanart_image', fanart)
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
        return ok
        
              
params=get_params()
url=None
name=None
mode=None

try:
        url=urllib.unquote_plus(params["url"])
except:
        pass
try:
        name=urllib.unquote_plus(params["name"])
except:
        pass
try:
        mode=int(params["mode"])
except:
        pass

print "Mode: "+str(mode)
print "URL: "+str(url)
print "Name: "+str(name)

if mode==None or url==None or len(url)<1:
        print ""
        MovieSearch(url)      

elif mode==1:
        print ""+url
        VIDEOLINKS(url,name)
        
elif mode==2:
        print ""+url
        playVid(url)
        
		





xbmcplugin.endOfDirectory(int(sys.argv[1]))  
Oh

on the

Code: Select all

def playVid(url):
        content = getUrl(url)
        match1=re.compile('"Javascript.*\http\://www.(.*).\"').findall(content)
        for url in match1:
          url = 'http://www.' + url
          url = url[:-5]
          url = url
          hostUrl = url
          videoLink = urlresolver.resolve(hostUrl)
          addLink(name,url,'')
          xbmc.Player().play(videoLink)
we have following:

hostUrl = url create a new variable with the name hostUrl what is url
videoLink = urlresolver.resolve(hostUrl) declarecd the variable videolink as urlresolver.resolve(hostUrl)
urlresolver.resolve(hostUrl) the urlresolver access as example a putlockker url and do all the code self , from the url to the playable stream
addLink(name,url) is a dummy link without that the movie will redirect!

this is not the right solution but the movie25.com site give first the name from the hoster and only a new match give the full url from the hoster
with this code we click on the given link on the addon and its will play the stream without to have click again for the open hoster link!

the right way for addon to access the stream or better media is over the addlink function over isplayable true on the addlink function

the code where this:

Code: Select all

def playVid(url):
        content = getUrl(url)
        match1=re.compile('"Javascript.*\http\://www.(.*).\"').findall(content)
        for url in match1:
          url = 'http://www.' + url
          url = url[:-5]
          url = url
          addLink(name,urlresolver.resolve(url),'')
this will access the stream without xbmcplayer.play() but with one click more on this example

full working movie25.com search addon link please install over the addon4xbox installer:
http://dl.dropbox.com/u/83714583/plugin ... Search.zip
Last edited by skatulskijean on Thu Mar 28, 2013 3:07 pm, edited 28 times in total.
User avatar
Dom DXecutioner
Posts: 585
Joined: Thu Jul 05, 2012 11:59 pm
Location: California
Has thanked: 249 times
Been thanked: 219 times
Contact:

Re: Creating Addons for xbmc4xbox example movie25.com

Post by Dom DXecutioner »

Good start!

I think it'd be logical to have a "Scripts & Addons Development" forum, then this could be placed on a sticky. I wonder why no one has thought of it before!? ;)
Image
User avatar
Kozz
Posts: 238
Joined: Wed Jul 04, 2012 4:42 am
Has thanked: 22 times
Been thanked: 51 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by Kozz »

This is nice to have Jan,
I was working on an addon myself a few weeks ago for videobull.com and found some good documentation on how to test scraping of web pages from the python shell on your desktop pc,

I found this page useful but might be a little hard for some people to follow
http://wiki.xbmc.org/index.php?title=HO ... s_for_XBMC

I think the original .doc file written by Voinage is easier to follow and get a basic understanding of how to scrape sites with python
https://voinage-xbmc-plugins.googlecode ... torial.rar


Also I think I will make a google code page with what I have made for my videobull.com addon and have a thread for it, maybe you or others can help with making the adfly routine
Image
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

Kozz wrote:This is nice to have Jan,
I was working on an addon myself a few weeks ago for videobull.com and found some good documentation on how to test scraping of web pages from the python shell on your desktop pc,

I found this page useful but might be a little hard for some people to follow
http://wiki.xbmc.org/index.php?title=HO ... s_for_XBMC

I think the original .doc file written by Voinage is easier to follow and get a basic understanding of how to scrape sites with python
https://voinage-xbmc-plugins.googlecode ... torial.rar


Also I think I will make a google code page with what I have made for my videobull.com addon and have a thread for it, maybe you or others can help with making the adfly routine
Yes its right but the different on this thread i create with the user a real working movie25.com addon for xbmc4xbox and that step by step!
that is that wath many user wanted and we make its self and forgot the fucking python compatible isue on xmc4xbox!

I start this and this on a language what is no my language but i do it and hope the user will not ask for this and that and follow this thread and the brain and make self what he want !
then we can say we have a community and with community i mean not 3 or 4 user what will what do i mean all the others what still sleeping and
nothing do as ask !

Regards Jan


ps
what for a adfly routine , the external links since accesable she sine Base64 encodet you must she decode with python and you have the movie links for putlocker sockshare and the other and this can you handle over the urlresolver the other since most pay links!

example :

Code: Select all

import base64



regexlink = 'aHR0cDovL3d3dy5wdXRsb2NrZXIuY29tL2ZpbGUvOEQxNjQ3RDZERTE3MDQ0NQ=='


url = base64.b64decode(regexlink)
print 'Entschlüsselt :', url
with access the stream over the urlresolver

Code: Select all

import xbmc
import urlresolver
import base64



regexlink = 'aHR0cDovL3d3dy5wdXRsb2NrZXIuY29tL2ZpbGUvOEQxNjQ3RDZERTE3MDQ0NQ=='


url = base64.b64decode(regexlink)
print 'Entschlüsselt :', url
hostUrl = url
videoLink = urlresolver.resolve(hostUrl)
xbmc.Player().play(videoLink)
the regexlink is a result from a match from the vidbull.com site
whufclee
Posts: 922
Joined: Tue Jul 17, 2012 5:42 pm
Location: Essex, UK
Has thanked: 18 times
Been thanked: 109 times
Contact:

Re: Creating Addons for xbmc4xbox example movie25.com

Post by whufclee »

Thanks Jan, I've bookmarked this and will take a good look at it later in the week. I had given up on trying to learn how to code an addon but this may rekindle my interest :)
k1m05
Posts: 47
Joined: Sun Jul 08, 2012 11:15 pm
Has thanked: 54 times
Been thanked: 11 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by k1m05 »

I agree with whufclee on that. This seems to be a great easy to follow tutorial. Will be studying this for sure :) Thanks
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

thanks for the kindly words:

Day 2 is up we create a seach the movie25.com search

regards Jan ;)
KaNiMziE
Posts: 3
Joined: Fri Mar 15, 2013 4:06 am

Re: Creating Addons for xbmc4xbox example movie25.com

Post by KaNiMziE »

skatulskijean wrote:Day 1
....
this give on the page source this:

Code: Select all

<div class="movie_pic"><a href="http://movie25.com/movies/dark-feed-2013.html"><img src="http://i.imgur.com/myYZY04.jpg" width="101" height="150"></a></div>
  <div class="movie_about">
    <div class="movie_about_text">
      <h1><a href="http://movie25.com/movies/dark-feed-2013.html">Dark Feed (2013)</a>
ok this give the url to the link for the movie ,the thunbnail and the name!

Open the the downloade script with idle (this is the standart Editor what come with you installed python).
Put the url http://movie25.com/movies/d/ on url='http://movie25.com/movies/d/ 'on the script.
Pres f5 and its open the python shell with the resonse info from the site!

Code: Select all

Date: Tue, 19 Mar 2013 14:06:58 GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
Last-Modified: Tue, 19 Mar 2013 07:14:21 GMT
ETag: "6570118-dc68-4d841dabaed40"
Accept-Ranges: bytes
Content-Length: 56424
Cache-Control: max-age=300
Expires: Tue, 19 Mar 2013 14:11:58 GMT
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html

>>> 
write link on the open pythonshell and press enter and you see the sources ready to scrap!
ok openFind on the python shell and search for movies/dark-feed-2013.html!

ok this is what we want:

Code: Select all

<div class="movie_pic"><a href="http://movie25.com/movies/dark-feed-2013.html" ><img src="http://i.imgur.com/myYZY04.jpg" width="101" height="150" /></a></div>\n  <div class="movie_about">\n    <div class="movie_about_text">\n      <h1><a href="http://movie25.com/movies/dark-feed-2013.html" >Dark Feed (2013)</a>
ok copy this and paste it to the script :
this is what we have then:

Code: Select all

match=re.compile('<div class="movie_pic"><a href="http://movie25.com/movies/dark-feed-2013.html" ><img src="http://i.imgur.com/myYZY04.jpg" width="101" height="150" /></a></div>\n  <div class="movie_about">\n    <div class="movie_about_text">\n      <h1><a href="http://movie25.com/movies/dark-feed-2013.html" >Dark Feed (2013)</a>').findall(link)

Hello, I follow your guide step - by - step !
I like to understand better my python! ( first time with that )

Well, I try to adapt your guide to dpstream.net ( french movie )

But when I try to get this:

Code: Select all

<div class="movie_pic"><a href="http://movie25.com/movies/dark-feed-2013.html"><img src="http://i.imgur.com/myYZY04.jpg" width="101" height="150"></a></div>
  <div class="movie_about">
    <div class="movie_about_text">
      <h1><a href="http://movie25.com/movies/dark-feed-2013.html">Dark Feed (2013)</a>
I not see same structure on the dpstream.net, I got this:

Code: Select all

  
 ....

					</div>					
					<div id="tri_liste_film">
												
						<table class="clfilm" cellspacing="0" cellpadding="10">
							<tr valign="center" style="background-color:#171717">
								<td id="ty1">Plateformes </td>
								<td id="ty2">Titre</td>
								<td id="ty3">
									<a onclick="javascript:clichref(this);" id="anneeclass" class="lp" href="/?action=film&p=0-0-1-0-0-1-0-0-0-0">Année <img src="/fichiers/images/none.png"></a><script>GetId('anneeclass').href='film.html#p0-0-1-0-0-1-0-0-0-0';</script>								</td>
								<td id="ty4">Pays</td>
								<td id="ty5">
									<a onclick="javascript:clichref(this);" id="noteclass" class="lp" href="/?action=film&p=0-0-1-0-0-0-1-0-0-0">Note <img src="/fichiers/images/none.png"></a>									<script>GetId('noteclass').href='film.html#p0-0-1-0-0-0-1-0-0-0';</script>								</td>
								<td id="ty6">Réalisateur</td>
								<td id="ty7">Acteurs</td>
							<tr>
															<tr valign="center" style="background-color:#202020">
									<td id="ty8">
																			<div class="plat_icone">
										<img style="margin-left:-10px;margin-top:1px;" src=""/></div>
																				<div class="plat_icone">
										<img style="margin-left:-10px;margin-top:1px;" src="/fichiers/images/purevid.png"/></div>
																			</td>
									<td id="ty9"><a class="lienfilm" onmouseover="montre('synop_98738');" onmouseout="cache();" href="films--5-a-day-un-amour-de-pere-en-streaming-382955.html">$5 a Day : Un amour de père</a></td>									<td id="ty10">
										2008									</td>
									<td id="ty11">
										Etats-Unis									</td>	
									<td>
										<div class="ef">
											<div class="ep" style="width:44px;"><br></div>
										</div>
										<div id="di1">
											<span id="sp1">5.5</span>
											<span id="sp2"> | 145 votes</span>
										</div>
									</td>
									<td id="ty12">
										<a href="javascript:cherche_act_rea('Nigel Cole')"></a> 									</td>	
									<td id="ty13">
										<a href="javascript:cherche_act_rea('Dean Cain')">Dean Cain</a>,  <a href="javascript:cherche_act_rea('Amanda Peet')">Amanda Peet</a>,  <a href="javascript:cherche_act_rea('Alessandro Nivola')">Alessandro Nivola</a> 									
									</td>										
									
								</tr>
																<tr valign="center" style="background-color:#121212">
									<td id="ty8">
																			<div class="plat_icone">
										<img style="margin-left:-10px;margin-top:1px;" src="/fichiers/images/mix.png"/></div>
																				<div class="plat_icone">
										<img style="margin-left:-10px;margin-top:1px;" src="/fichiers/images/purevid.png"/></div>
																			</td>
									<td id="ty9"><a class="lienfilm" onmouseover="montre('500-days-of-summer');" onmouseout="cache();" href="films--500-jours-ensemble-en-streaming-510401.html">(500) jours ensemble</a></td>									<td id="ty10">
										2007									</td>
									<td id="ty11">
										États-Unis									</td>	
									<td>
										<div class="ef">
											<div class="ep" style="width:68px;"><br></div>
										</div>
										<div id="di1">
											<span id="sp1">8.6</span>
											<span id="sp2"> | 835 votes</span>
										</div>
									</td>
									<td id="ty12">
										<a href="javascript:cherche_act_rea('Marc Webb')">Marc Webb</a> 									</td>	
									<td id="ty13">
										<a href="javascript:cherche_act_rea('Zooey Deschanel')">Zooey Deschanel</a>,  <a href="javascript:cherche_act_rea('Joseph Gordon-Levitt')">Joseph Gordon-Levitt</a>,  <a href="javascript:cherche_act_rea('Clark Gregg')">Clark Gregg</a>,  <a href="javascript:cherche_act_rea('Minka Kelly')">Minka Kelly</a> 									
									</td>										
									
								</tr>

I make my test with letter 'e' from main page on dpstream.net
I includ the source page result (dpstream.py)

What is the way to get the list ?

Can you help me to make my good string ?

KaNiMziE

http://dl.dropbox.com/u/94267482/DPSteam.py
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

@ KaNiMziE

Yes the Sites have not the same structur and this is what i mean it is learning by doing!
I have a Problem to help you from Germany the Site is lagging and give me http errors here so that i can not access the linked source on the python shell but a little help from me is here!

Ok my friend the structur from the websites since different but what we do is the same!
Your have a look on the Letta E
the url for this Letta (First Site) is http://dpstream.net/film.html#p0-6-0-0-0-0-0-0-0-0
when we look for the first movie name we see
E.T. l'extra-terrestre Movie Title we make a right mouse click and open the Movie link with the url http://dpstream.net/films-e.t.-l-extra- ... 66018.html
we go back to the http://dpstream.net/film.html#p0-6-0-0-0-0-0-0-0-0 and locking on the sources for this page what we search is only
films-e.t.-l-extra-terrestre-en-streaming-366018.html .
on the Pagesources we find that:
what you want is blue
<td id="ty9"><a class="lienfilm" onmouseover="montre('e-t-l-extraterrestre');" onmouseout="cache();" href="films-e.t.-l-extra-terrestre-en-streaming-366018.html">

we must search this on the linked pythonshell
this give you the url and the name for the movie and with this you must make the regex for it!

i hope this help a little!
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

DAY 3 is up we create the Genre script


Regards Jan
User avatar
Kozz
Posts: 238
Joined: Wed Jul 04, 2012 4:42 am
Has thanked: 22 times
Been thanked: 51 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by Kozz »

Thanks for that Base64 information Jan :)

I got it to play videos from Videobull.com in xbmc using

Code: Select all

def PLAYLINKS(url,name):
        regexlink = url
        url = base64.b64decode(regexlink)
        hostUrl = url
        videoLink = urlresolver.resolve(hostUrl)
        addLink(name,'videoLink','')
        playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        playlist.clear()
        playlist.add(videoLink)
        xbmc.Player().play(playlist)
It will take me some time to work out the rest of the functions but soo I should be releasing an inital Videobull.com addon
Image
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

Kozz wrote:Thanks for that Base64 information Jan :)

I got it to play videos from Videobull.com in xbmc using

Code: Select all

def PLAYLINKS(url,name):
        regexlink = url
        url = base64.b64decode(regexlink)
        hostUrl = url
        videoLink = urlresolver.resolve(hostUrl)
        addLink(name,'videoLink','')
        playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        playlist.clear()
        playlist.add(videoLink)
        xbmc.Player().play(playlist)
It will take me some time to work out the rest of the functions but soo I should be releasing an inital Videobull.com addon

Nice Kozz !

It give a lot solution to develop addon for xbmc4xbox!
Over the standart way what i think its the best way to understand!
Over Tommo.common and urlresolver or over xbmcswift wath is verry nice and under the hut a lot better as the other but the syntax is ...... :D
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

Day4 for is up we learn a regex Meta and make the regex search a little different to before and bring two search to one solution!

Tomorrow we create the videolink regex and macking a movie 25 search xbmc4xbox addon what works on mainxbmc to

:D

Regard Jan
k1m05
Posts: 47
Joined: Sun Jul 08, 2012 11:15 pm
Has thanked: 54 times
Been thanked: 11 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by k1m05 »

This is great Jan. Never had so much luck with python before. I'm using your tutorial to work on another site for Wrestling and MMA shows and PPV Replays. I really cant wait to finish it. Wanted to make this addon for a very long time now. Will let you know what I come up with so maybe we could get it on the repo, If I ever get it working that is. Thank you so very much :)
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

k1m05 wrote:This is great Jan. Never had so much luck with python before. I'm using your tutorial to work on another site for Wrestling and MMA shows and PPV Replays. I really cant wait to finish it. Wanted to make this addon for a very long time now. Will let you know what I come up with so maybe we could get it on the repo, If I ever get it working that is. Thank you so very much :)
day 5 is up we creating the videolink and the resolvehoster script!

i have not the time for more this day but tomorrow we create a full working xbmc4xbox movie25.com search addon!

when you have time you can give me the link to the sites what you will have on a addon!

:)
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

day 5 is up we creating the videolink and the resolvehoster script!

i have not the time for more this day but tomorrow we create a full working xbmc4xbox movie25.com search addon!
k1m05
Posts: 47
Joined: Sun Jul 08, 2012 11:15 pm
Has thanked: 54 times
Been thanked: 11 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by k1m05 »

HERE is the link to the site you asked for. Thanks again for your work with this tutorial. Super easy to follow. :)
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

DAY SIX we create a full working movie25.com search script is up:

With download from the working movie25.comSearch addon

Regards Jan :D
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by skatulskijean »

k1m05 wrote:HERE is the link to the site you asked for. Thanks again for your work with this tutorial. Super easy to follow. :)
Yes is a nice site the only problem is not all host since supported put i think pro video its one what is suported by the urlresolver the igger problem i think so since that most of the stream on hd what simply not works on the xbox !
the asess for the payable url is very simple its works over a feed xml . what you can a little simpler access over the scriptmodulefeedparser what since on the xbmc4xbox repo under scriptmodule .
to access the and closed link you need to set the struktur what this have under the scriptmodule.feedparser self without it can not understand for what you ask him!
k1m05
Posts: 47
Joined: Sun Jul 08, 2012 11:15 pm
Has thanked: 54 times
Been thanked: 11 times

Re: Creating Addons for xbmc4xbox example movie25.com

Post by k1m05 »

skatulskijean wrote:
k1m05 wrote:HERE is the link to the site you asked for. Thanks again for your work with this tutorial. Super easy to follow. :)
Yes is a nice site the only problem is not all host since supported put i think pro video its one what is suported by the urlresolver the igger problem i think so since that most of the stream on hd what simply not works on the xbox !
the asess for the payable url is very simple its works over a feed xml . what you can a little simpler access over the scriptmodulefeedparser what since on the xbmc4xbox repo under scriptmodule .
to access the and closed link you need to set the struktur what this have under the scriptmodule.feedparser self without it can not understand for what you ask him!

Most of the HD content is .rar and unplayable anyway except for the half hour shows. And there are SD Copies of all the shows I have found on there. I have not been able to work on it for a while, had some complications at the dentist and been put on Valium for a dislocated jaw and Temporomandibular Joint Disorder. So much pain. So nice to be able to sleep again :) Will get back on the ball soon. Thanks for your input. Oh and dont do drugs guys unless you doctor tells you to.
Post Reply