TOOLSP
"
WELCOME !

Please ! Use [CODE] tags for your LINKS and CODE.
Favor usar balisas [CODE] para sus vínculos y código.
Merci d'utiliser les balises [CODE] pour vos liens et code.

[code]http://Thank.you[/code]
"
*** GITHUB ***
.
.
URL Resolver [GIT]
.
.
.
.
Jx Update [REDIRECT]
.
.
*** Associated ***
.
Pastebin Your list online
.
mediafire Upload Files
.
imgur Upload Pics
lyngsat TV logos collection
transparent .png
.
http://hola.org free? VPN
Hola.apk free? VPN App.
.
hidester- free Proxy
.
webgrabplus EPG - Eng
xmltv EPG - Fr
kazer EPG - Fr
.
.wordreference Traduction
.
mail.com (fast sign-in)
.
.
Latest topics
» SportsDevil back on Mega
Yesterday at 14:38 by skyhigh

» SportsDevil back on Mega
Fri 17 Nov - 5:30 by jairoxyz

» youtube playlists
Tue 14 Nov - 2:43 by jujuuj

» afromotion
Thu 9 Nov - 13:59 by doctor4979

» ? works on VLC, but not on kodi ?
Mon 6 Nov - 13:06 by jujuuj

» how make a request.post to get a repond
Tue 31 Oct - 16:01 by jujuuj

» how to play this in kodi
Tue 31 Oct - 15:21 by jujuuj

FRIENDS / PARTNERS

forum

créer un forum


youtube playlists

View previous topic View next topic Go down

youtube playlists

Post by udangaribaldi on Fri 10 Nov - 0:38

hi could you help me out with the method of adding a youtube playlist in £$π please
i can add user and channels but im stumped when trying to add playlists. any help much appreciated.
avatar
udangaribaldi

Messages : 6
Date d'inscription : 2017-10-18

View user profile

Back to top Go down

youtube playlist

Post by jujuuj on Fri 10 Nov - 17:15

hello,

basically, a playlist is a list of video, isn't it ?
so you have to build a makelist of links, in the page of the playlist

Opening a playlist, and checking source code, you can see
(assuming that \n is representing a new line) :
.......
dir="ltr" href="/watch?v=linkrefnumber".*?\n(title)\n
.......

so the expres should be ...
(underslash before forbidden characters)
(replacing the title and link ... by our parameters) :

dir="ltr" href="\/watch\?v=(.*?)".*?\n(.*?)\n


here an example
Code:


<item>
<title>[COLOR gold]FOOTBALL :  
NEWS   Youtube   [/COLOR]   </title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[makelist.param2]</title>
<link>plugin://plugin.video.youtube/play/?video_id=[makelist.param1]</link>
<thumbnail></thumbnail>
]]></listrepeat>
<expres>dir="ltr" href="\/watch\?v=(.*?)".*?\n(.*?)\n</expres>
<page>https://www.youtube.com/playlist?list=PLcTBPve8QnVdB8tYzufhZLLuHviXf8O52</page>
</regex>
</item>
  
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: youtube playlists

Post by udangaribaldi on Fri 10 Nov - 19:33

thank you very much Smile
avatar
udangaribaldi

Messages : 6
Date d'inscription : 2017-10-18

View user profile

Back to top Go down

Re: youtube playlists

Post by jujuuj on Sun 12 Nov - 16:39

no problem my friend : ) it's always a pleasure when I can help/answer Wink

have a look on this brillant item made by twogun, u should like it too ...

Code:


<item>
<title>Youtube  Search  (10 pages)  [by Twogun]</title>
<link>$doregex[makelist]</link>
<thumbnail>http://vignette3.wikia.nocookie.net/logopedia/images/7/76/Youtube-logo_2005-2009.jpg</thumbnail>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[makelist.param2]</title>
<link>$doregex[resolve]</link>
<thumbnail>https://i.ytimg.com/vi/[makelist.param1]/hqdefault.jpg</thumbnail>
]]></listrepeat>
<expres>u'(.+?)', u'(.+?)'</expres>
<page>$doregex[search]</page>
</regex>

<regex>
<name>resolve</name>
<expres><![CDATA[#$pyFunction
import urlresolver
def GetLSProData(page_data,Cookie_Jar,m):
 url = 'https://www.youtube.com/watch?v=[makelist.param1]'
 streamLink = urlresolver.resolve(url)
 return streamLink
]]></expres>
<page></page>
</regex>

<regex>
<name>search</name>
<expres><![CDATA[#$pyFunction
import requests,xbmcgui,xbmc, re,time, xbmcaddon
def GetLSProData(page_data,Cookie_Jar,m):

 text=takeInputFortext('Enter search string')
 url = 'https://www.youtube.com/results?q=' + text.replace(' ', '+')
 req = requests.get(url)
 list1 = re.findall('yt-lockup-c.+?a\shref=".watch.v=([^"]+)".+?\s\stitle="([^"]+)"\s', req.text)

 count = 10
 while count > 1:
  try:
    url = 'https://www.youtube.com' + re.findall('a href="([^"]+)".+<\/a>\n <\/div>', req.text)[0]
  except:
    return list1
  req = requests.get(url)
  list2 = re.findall('yt-lockup-c.+?a\shref=".watch.v=([^"]+)".+?\s\stitle="([^"]+)"\s', req.text)
  list1 = list1 + list2
  count = count - 1
 return list1

def takeInputFortext(txt):
 addon = xbmcaddon.Addon('plugin.video.live.streamspro')
 addon_version = addon.getAddonInfo('version')
 profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
 
 solver = InputWindow( txt=txt)
 solution = solver.get()
 return solution

class InputWindow(xbmcgui.WindowDialog):
    def __init__(self, *args, **kwargs):
       
        self.txt = kwargs.get('txt','')

        xbmcgui.WindowXMLDialog.__init__(self)
        #self.addControl(self.txt)
        path = xbmcaddon.Addon().getAddonInfo('path')
        self.kbd = xbmc.Keyboard()
        self.kbd.setHeading( self.txt)

    def get(self):
        self.show()
        time.sleep(2)
        self.kbd.doModal()
        if (self.kbd.isConfirmed()):
            text = self.kbd.getText()
            self.close()
            return text
        self.close()
        return False
]]></expres>
<page></page>
</regex>
</item>
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: youtube playlists

Post by jujuuj on Sun 12 Nov - 17:23

jason,

please tell me again what you wanted ?
i think u don't want " [private] " videos to appears in list ? what else ?
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: youtube playlists

Post by Jason on Sun 12 Nov - 17:25

hi jujuuj, your example youtube playlist code above works very well but i want to change a few things, can u help me please?

1. the code load the youtube playlist this is ok, unfortunately, there are also previews or private and deleted videos between the main videos. Is it possible to not load it?

2. the code automatically assigns the title and picture of the video!!! I would like to determine this myself is that possible?


https://www.youtube.com/playlist?list=PL2yjjEgnAItWNxBn8rnBCMjZldGAn5RHm

Code:
<item>
<title>[COLOR red]YT Playlist[/COLOR]</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[makelist.param2]</title>
<link>plugin://plugin.video.youtube/play/?video_id=[makelist.param1]</link>
<thumbnail>#</thumbnail>
]]></listrepeat>
<expres>dir="ltr" href="\/watch\?v=(.*?)".*?\n(.*?)\n</expres>
<page>https://www.youtube.com/playlist?list=PL2yjjEgnAItWNxBn8rnBCMjZldGAn5RHm</page>
</regex>
</item>



thank you
Jason

Jason

Messages : 14
Date d'inscription : 2017-06-18

View user profile

Back to top Go down

Re: youtube playlists

Post by jujuuj on Sun 12 Nov - 18:13

1/  a way to "filter" results ... is to find a difference between the one u want and the one u dont want
assuming that [private]  has these [ and ] ...  we have a difference.

... so we can modify the <expres> in order to avoid any text with ]  or [

in the original expres,  
<expres>dir="ltr" href="\/watch\?v=(.*?)".*?\n(.*?)\n</expres>
the last (.*?)  means take ()  anything .*? between \n and \n
(= all the line, anything inside)

we can modificate the .*?   anything
for a[^\[\]]+
that means anything except this [ and this ]
(note that i am obliged to write \[  and \]  when i mean [ and ], but these last 2 are "forbiden characters" ...)
so the NEW full express will be

<expres>dir="ltr" href="\/watch\?v=(.*?)".*?\n([^\[\]]+)\n</expres>

2/  u want to choose your own title and your own picture for a link ?

!no! it is not possible because what we ask here to £$π is to go and find in the source code of a webpage some elements, and your picture and yout personal title do not appear in this source code (of this webpage).

... it could be possible to have your own pictures and titles but only if you totally reproduce the source code and paste it inside of the <page> tag.

something like this :

<page>
href="link.ep.18" title="my good title18" img="mypicture"
href="link.ep.17" title="my good title17" img="mypicture"
href="link.ep.16" title="my good title16" img="mypicture"
href="link.ep.15" title="my good title15" img="mypicture"
href="link.ep.14" title="my good title14" img="mypicture"
href="link.ep.13" title="my good title13" img="mypicture"
href="link.ep.12" title="my good title.....         ="mypicture"
</page>

so when u run the makelist it does not search in the original sourcecode, but it looks in your adapted code
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: youtube playlists

Post by jujuuj on Sun 12 Nov - 18:16

1 / (alternative)

Q : "Is it possible to not load it?"

Answer:
http://toolsp.forumactif.com/t11-negative-lookahead
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: youtube playlists

Post by Jason on Sun 12 Nov - 18:40

thanks jujuuj for the infos and examples, but so much knowledge and experience i have not!!!

I messed things up and now it does not work anymore.
Can you please complete the code?

leastways this...

1. the code load the youtube playlist this is ok, unfortunately, there are also previews or private and deleted videos between the main videos. Is it possible to not load it?


thank you

Jason

Messages : 14
Date d'inscription : 2017-06-18

View user profile

Back to top Go down

Re: youtube playlists

Post by udangaribaldi on Mon 13 Nov - 0:03

nice that helps me also - thanks again and twogun
avatar
udangaribaldi

Messages : 6
Date d'inscription : 2017-10-18

View user profile

Back to top Go down

Re: youtube playlists

Post by jujuuj on Mon 13 Nov - 2:41

Jason wrote:thanks jujuuj for the infos and examples, but so much knowledge and experience i have not!!!

I messed things up and now it does not work anymore.
Can you please complete the code?

leastways this...

1. the code load the youtube playlist this is ok, unfortunately, there are also previews or private and deleted videos between the main videos. Is it possible to not load it?


thank you

IF you don't open the source code of your page YOU WILL NEVER LEARN ...

just replace the line <expres> by this one :
<expres>dir="ltr" href="\/watch\?v=(.*?)".*?\n([^\[\]]+)\n</expres>

to understand <expres> ,use regex101 (link in right widget called Testers
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: youtube playlists

Post by Jason on Mon 13 Nov - 10:29

jujuuj wrote:
Jason wrote:thanks jujuuj for the infos and examples, but so much knowledge and experience i have not!!!

I messed things up and now it does not work anymore.
Can you please complete the code?

leastways this...

1. the code load the youtube playlist this is ok, unfortunately, there are also previews or private and deleted videos between the main videos. Is it possible to not load it?


thank you

IF you don't open the source code of your page YOU WILL NEVER LEARN ...

just replace the line <expres>  by this one :
<expres>dir="ltr" href="\/watch\?v=(.*?)".*?\n([^\[\]]+)\n</expres>

to understand <expres>  ,use  regex101   (link in right widget called Testers



Bro. if i override the <express> line with yours then the list is shortened to 2 videos.

see Pic.


Before:




Later:


Jason

Messages : 14
Date d'inscription : 2017-06-18

View user profile

Back to top Go down

Re: youtube playlists

Post by jujuuj on Tue 14 Nov - 2:43

ok, so ...   open https://regex101.com/
paste the first version of expres   (UP)
paste the source code,                  (DOWN)
and clic on SAVE
then send me the url ( http://regex101 /...............


and answer me precisely  what lines you dont want
...if u can tell me the line-number (in sourcecode) of the link you dont want to see in solution
or write it ..

(note that I dont see the same words in french version of this youtube-page  ... so be explicite)
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum