Springen naar inhoud


Foto

mytube plugin issues


  • Please log in to reply
Er zijn 23 reacties in dit onderwerp

#1 bacicciosat

  • Senior Member
  • 540 berichten

+100
Excellent

Geplaatst op 30 juli 2013 - 13:24

Hi ppl

I took a glance to mytube plugin and the problem of "video not available"

 

It seems that the issue is present when the signature key is 's' instead of 'sig'

 

I took a glance at youtube plugin fox Xbmc and at Youtube-DL project and i found that when the signature key is 's' it needs to be decrypted.

So i tried to add the "s" key case and the decrypt function used in those plugins as you can see here

https://github.com/H...ouTubePlayer.py

 

to implement the 's' key and signature decription i have changed the code in MyTubeService.py in this way

					for arg in fmtstring.split('&'):
						if arg.find('=') >= 0:
							print arg.split('=')
							key, value = arg.split('=')
							if key == 'itag':
								if len(value) > 3:
									value = value[:2]
								fmtid = value
							elif key == 'url':
								fmturl = value
							elif key == 'sig':
								fmtsig = value
							elif key == 's':
								fmtsig = self.decrypt_signature(value)
								print '[MyTubeMeo] signature: %s' % (value)







.....................

	def decrypt_signature(self, s):
		if len(s) == 92:
			return s[25] + s[3:25] + s[0] + s[26:42] + s[79] + s[43:79] + s[91] + s[80:83]
		elif len(s) == 90:
			return s[25] + s[3:25] + s[2] + s[26:40] + s[77] + s[41:77] + s[89] + s[78:81]
		elif len(s) == 88:
			return s[48] + s[81:67:-1] + s[82] + s[66:62:-1] + s[85] + s[61:48:-1] + s[67] + s[47:12:-1] + s[3] + s[11:3:-1] + s[2] + s[12]
		elif len(s) == 87:
			return s[4:23] + s[86] + s[24:85]
		elif len(s) == 86:
			return s[2:63] + s[82] + s[64:82] + s[63]
		elif len(s) == 85:
			return s[2:8] + s[0] + s[9:21] + s[65] + s[22:65] + s[84] + s[66:82] + s[21]
		elif len(s) == 84:
			return s[83:36:-1] + s[2] + s[35:26:-1] + s[3] + s[25:3:-1] + s[26]
		elif len(s) == 83:
			return s[6] + s[3:6] + s[33] + s[7:24] + s[0] + s[25:33] + s[53] + s[34:53] + s[24] + s[54:]
		elif len(s) == 82:
			return s[36] + s[79:67:-1] + s[81] + s[66:40:-1] + s[33] + s[39:36:-1] + s[40] + s[35] + s[0] + s[67] + s[32:0:-1] + s[34]
		elif len(s) == 81:
			return s[56] + s[79:56:-1] + s[41] + s[55:41:-1] + s[80] + s[40:34:-1] + s[0] + s[33:29:-1] + s[34] + s[28:9:-1] + s[29] + s[8:0:-1] + s[9]
		elif len(s) == 79:
			return s[54] + s[77:54:-1] + s[39] + s[53:39:-1] + s[78] + s[38:34:-1] + s[0] + s[33:29:-1] + s[34] + s[28:9:-1] + s[29] + s[8:0:-1] + s[9]
		else:
			print "Unable to decrypt signature, key length %d not supported"

 

Now all the video seems to start, the url seems ok but the play fails.

Playing URL http://r3---sn-nx5cvox-hpa6.c.youtube.com/videoplayback?ipbits=8&cp=U0hWSlJLVl9HT0NONl9KRVpJOlFWdVM0bWpVNGJG&sparams=cp%2Cgcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&gcr=it&ratebypass=yes&id=85309961921ac719&upn=kjhAhxVjYuM&fexp=917000%2C914501%2C901700%2C910207%2C916714%2C916624%2C909546%2C906397%2C929117%2C929121%2C929906%2C929907%2C925720%2C925722%2C925718%2C925714%2C929917%2C929919%2C912521%2C904492%2C904830%2C919373%2C904122%2C932216%2C908534%2C919387%2C936303%2C909549%2C900816%2C936301%2C912711%2C935000&ms=au&key=yt1&source=youtube&mv=m&itag=37&expire=1375208825&ip=80.117.223.123&sver=3&mt=1375185274&signature=66A303CFBE998D201100D65DA994398B877F165A04F57DB902586F51F8C170B0FBEB0CB976D08E5E.
evEOF=7
seekable status changed!
setSeekState
trying to switch to playing- state: 1
No Service found
playing service..

 

Is there anyone that have an idea to fix ?



Re: mytube plugin issues #2 luis67

  • Senior Member
  • 76 berichten

0
Neutral

Geplaatst op 30 juli 2013 - 14:43

Yes i have the same problem on dreambox 500 hd with latest Openpli 3.0 image

Re: mytube plugin issues #3 betacentauri

  • PLi® Core member
  • 7185 berichten

+323
Excellent

Geplaatst op 30 juli 2013 - 16:52

Only a guess:
Can you store the video data in a file and try to playback it with e.g vlc?
Perhaps your decryption is not working and no valid video data is returned by the server.
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: mytube plugin issues #4 gorski

  • Senior Member
  • 1699 berichten

+46
Good

Geplaatst op 31 juli 2013 - 15:13

Does it work with TSmedia? If it does, maybe a clue is there...?


<span style='font-family: comic sans ms,cursive'>"Enlightenment is man's emergence from his self-incurred immaturity. Immaturity is the inability to use one's own understanding without the guidance of another. This immaturity is self-incurred if its cause is not lack of understanding, but lack of resolution and courage to use it without the guidance of another. The motto of enlightenment is therefore: Sapere aude! Have courage to use your own understanding!</span><br /> <br /><span style='font-family: comic sans ms,cursive'>Laziness and cowardice are the reasons why such a large proportion of men, even when nature has long emancipated them from alien guidance..." I. Kant, "Political writings" (1784)</span><br /> <br /><span style='font-family: comic sans ms,cursive'><a class='bbc_url' href='<a class='bbc_url' href='http://eserver.org/p...lightenment.txt'>http://eserver.org/p...ent.txt</a>'><a class='bbc_url' href='http://www.english.upenn.edu/~mgamer/Etexts/kant.html</a>'>http://www.english.upenn.edu/~mgamer/Etexts/kant.html</a></a> - the jolly text on Enlightenment, at the basis of Modernity...</span>

Re: mytube plugin issues #5 littlesat

  • PLi® Core member
  • 56555 berichten

+693
Excellent

Geplaatst op 31 juli 2013 - 17:20

Tsmedia is closed source as far i know... But it doesn't have a dmm only license as mytube has.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: mytube plugin issues #6 gorski

  • Senior Member
  • 1699 berichten

+46
Good

Geplaatst op 31 juli 2013 - 17:58

I see... Had no clue... Thanx!


<span style='font-family: comic sans ms,cursive'>"Enlightenment is man's emergence from his self-incurred immaturity. Immaturity is the inability to use one's own understanding without the guidance of another. This immaturity is self-incurred if its cause is not lack of understanding, but lack of resolution and courage to use it without the guidance of another. The motto of enlightenment is therefore: Sapere aude! Have courage to use your own understanding!</span><br /> <br /><span style='font-family: comic sans ms,cursive'>Laziness and cowardice are the reasons why such a large proportion of men, even when nature has long emancipated them from alien guidance..." I. Kant, "Political writings" (1784)</span><br /> <br /><span style='font-family: comic sans ms,cursive'><a class='bbc_url' href='<a class='bbc_url' href='http://eserver.org/p...lightenment.txt'>http://eserver.org/p...ent.txt</a>'><a class='bbc_url' href='http://www.english.upenn.edu/~mgamer/Etexts/kant.html</a>'>http://www.english.upenn.edu/~mgamer/Etexts/kant.html</a></a> - the jolly text on Enlightenment, at the basis of Modernity...</span>

Re: mytube plugin issues #7 mfaraj57

  • Senior Member
  • 1605 berichten

+286
Excellent

Geplaatst op 31 juli 2013 - 20:00

no problem i can post the source of TSmedia-mytube
however it depends on similar file to the file MyTubeService.py on decoding youtube video address
i applied in the past the solution of bacicciosat and no video available message disappeared but as mentioned playing failed
now i do not have example of none available video if one can post example to test
also i am thinking to catch the url from playing the youtube video in pc and compare it with the one decrypted by MyTubeService.py to see where is the difference

Veranderd door mfaraj57, 31 juli 2013 - 20:03


Re: mytube plugin issues #8 mfaraj57

  • Senior Member
  • 1605 berichten

+286
Excellent

Geplaatst op 31 juli 2013 - 20:09

this the procedure to decrypt the video

from mytube import youtubeUrl
y = youtubeUrl(self.session)
y.addErrback(self.youtubeErr)
self.videoPrio=int(config.plugins.tstube.vidqual.value)
dhLink = y.getVideoUrl(dhVideoId, self.videoPrio)

Bijgevoegde Bestanden



Re: mytube plugin issues #9 bacicciosat

  • Senior Member
  • 540 berichten

+100
Excellent

Geplaatst op 1 augustus 2013 - 11:53

no problem i can post the source of TSmedia-mytube
however it depends on similar file to the file MyTubeService.py on decoding youtube video address
i applied in the past the solution of bacicciosat and no video available message disappeared but as mentioned playing failed
now i do not have example of none available video if one can post example to test
also i am thinking to catch the url from playing the youtube video in pc and compare it with the one decrypted by MyTubeService.py to see where is the difference

 

I don't see in your file a method to decrypt signature.

Are you sure that the video with encrypted signature are working in TS-media ?

just to examples not working in my tube. Search for:

The Gummy Bear Song - Long English Version

Malika Ayane - E se poi - Sanremo 2013



Re: mytube plugin issues #10 mfaraj57

  • Senior Member
  • 1605 berichten

+286
Excellent

Geplaatst op 1 augustus 2013 - 12:45


no problem i can post the source of TSmedia-mytube
however it depends on similar file to the file MyTubeService.py on decoding youtube video address
i applied in the past the solution of bacicciosat and no video available message disappeared but as mentioned playing failed
now i do not have example of none available video if one can post example to test
also i am thinking to catch the url from playing the youtube video in pc and compare it with the one decrypted by MyTubeService.py to see where is the difference

 
I don't see in your file a method to decrypt signature.
Are you sure that the video with encrypted signature are working in TS-media ?
just to examples not working in my tube. Search for:
The Gummy Bear Song - Long English Version
Malika Ayane - E se poi - Sanremo 2013


If this is your not working video

it is ok in TSmedia
if you have TSmedia you can check TSmedia/Netmedia/youtube/channel feeds/live channels

Veranderd door mfaraj57, 1 augustus 2013 - 12:46


Re: mytube plugin issues #11 bacicciosat

  • Senior Member
  • 540 berichten

+100
Excellent

Geplaatst op 1 augustus 2013 - 13:31

Ok i have simply changed in MyTubeService.py the function getVideoUrl

in this way.

def getVideoUrl(self, url, videoPrio=0):
	# this part is from mtube plugin
		print "got url:", url
		if videoPrio == 0:
			VIDEO_FMT_PRIORITY_MAP = {
				'38' : 6, #MP4 Original (HD)
				'37' : 5, #MP4 1080p (HD)
				'22' : 4, #MP4 720p (HD)
				'35' : 2, #FLV 480p
				'18' : 1, #MP4 360p
				'34' : 3, #FLV 360p
			}
		elif videoPrio == 1:
			VIDEO_FMT_PRIORITY_MAP = {
				'38' : 6, #MP4 Original (HD)
				'37' : 5, #MP4 1080p (HD)
				'22' : 1, #MP4 720p (HD)
				'35' : 3, #FLV 480p
				'18' : 2, #MP4 360p
				'34' : 4, #FLV 360p
			}
		else:
			VIDEO_FMT_PRIORITY_MAP = {
				'38' : 3, #MP4 Original (HD)
				'37' : 1, #MP4 1080p (HD)
				'22' : 2, #MP4 720p (HD)
				'35' : 5, #FLV 480p
				'18' : 4, #MP4 360p
				'34' : 6, #FLV 360p
			}
		
		video_url = None
		video_id = url

		# Getting video webpage
		#URLs for YouTube video pages will change from the format http://www.youtube.com/watch?v=ylLzyHk54Z0 to http://www.youtube.com/watch#!v=ylLzyHk54Z0.
		watch_url = 'http://www.youtube.com/watch?v=%s&gl=US&hl=en' % video_id
		watchrequest = Request(watch_url, None, std_headers)
		try:
			print "[youtubeUrl] trying to find out if a HD Stream is available",watch_url
			watchvideopage = urlopen2(watchrequest).read()
		except (URLError, HTTPException, socket.error), err:
			self.error = "Error: Unable to retrieve watchpage - Error code: %s" % str(err)
			self.errReturn(video_url)
			return video_url
		
		# Get video info
		for el in ['&el=embedded', '&el=detailpage', '&el=vevo', '']:
			info_url = ('http://www.youtube.com/get_video_info?&video_id=%s%s&ps=default&eurl=&gl=US&hl=en' % (video_id, el))
			request = Request(info_url, None, std_headers)
			try:
				infopage = urlopen2(request).read()
				videoinfo = parse_qs(infopage)
				if ('url_encoded_fmt_stream_map' or 'fmt_url_map') in videoinfo:
					break
			except (URLError, HTTPException, socket.error), err:
				self.error = "Error: unable to download video infopage - %s" % str(err)
				self.errReturn(video_url)
				return video_url
			
		if ('url_encoded_fmt_stream_map' or 'fmt_url_map') not in videoinfo:
			# Attempt to see if YouTube has issued an error message
			if 'reason' not in videoinfo:
				self.error = 'Error: unable to extract "fmt_url_map" or "url_encoded_fmt_stream_map" parameter for unknown reason'
			else:
				reason = unquote_plus(videoinfo['reason'][0])
				self.error = 'Error: YouTube said: %s' % reason.decode('utf-8')

			self.errReturn(video_url)
			return video_url

		video_fmt_map = {}
		fmt_infomap = {}
		if videoinfo.has_key('url_encoded_fmt_stream_map'):
			tmp_fmtUrlDATA = videoinfo['url_encoded_fmt_stream_map'][0].split(',')
		else:
			tmp_fmtUrlDATA = videoinfo['fmt_url_map'][0].split(',')
		for fmtstring in tmp_fmtUrlDATA:
			fmturl = fmtid = fmtsig = ""
			if videoinfo.has_key('url_encoded_fmt_stream_map'):
				try:
					for arg in fmtstring.split('&'):
						if arg.find('=') >= 0:
							print arg.split('=')
							key, value = arg.split('=')
							if key == 'itag':
								if len(value) > 3:
									value = value[:2]
								fmtid = value
							elif key == 'url':
								fmturl = value
							elif key == 'sig':
								fmtsig = value
								
					if fmtid != "" and fmturl != "" and fmtsig != ""  and VIDEO_FMT_PRIORITY_MAP.has_key(fmtid):
						video_fmt_map[VIDEO_FMT_PRIORITY_MAP[fmtid]] = { 'fmtid': fmtid, 'fmturl': unquote_plus(fmturl), 'fmtsig': fmtsig }
						fmt_infomap[int(fmtid)] = "%s&signature=%s" %(unquote_plus(fmturl), fmtsig)
					fmturl = fmtid = fmtsig = ""

				except:
					self.error = "error parsing fmtstring: %s" % fmtstring
					self.errReturn(video_url)
					return video_url
					
			else:
				(fmtid,fmturl) = fmtstring.split('|')
			if VIDEO_FMT_PRIORITY_MAP.has_key(fmtid) and fmtid != "":
				video_fmt_map[VIDEO_FMT_PRIORITY_MAP[fmtid]] = { 'fmtid': fmtid, 'fmturl': unquote_plus(fmturl) }
				fmt_infomap[int(fmtid)] = unquote_plus(fmturl)
		print "[youtubeUrl] got",sorted(fmt_infomap.iterkeys())
		if video_fmt_map and len(video_fmt_map):
			print "[youtubeUrl] found best available video format:",video_fmt_map[sorted(video_fmt_map.iterkeys())[0]]['fmtid']
			best_video = video_fmt_map[sorted(video_fmt_map.iterkeys())[0]]
			video_url = "%s&signature=%s" %(best_video['fmturl'].split(';')[0], best_video['fmtsig'])
			print "[youtubeUrl] found best available video url:",video_url

			return video_url

 

Maybe it will works in Pli image.

In Black Hole it doesn't works

 

eServiceMP3::state transition NULL -> READY
eServiceMP3::GST_STREAM_STATUS_TYPE_CREATE -> setting timeout on souphttpsrc to 10s
Gstreamer error: Forbidden (domain:1304, code:5) from source
Gstreamer error: Stream contains no data. (domain:1305, code:4) from typefindelement0
crc32 failed! is dbd59f9f


Re: mytube plugin issues #12 bacicciosat

  • Senior Member
  • 540 berichten

+100
Excellent

Geplaatst op 1 augustus 2013 - 14:44

After more tests, i think the code of TSmedia-mytube posted here cannot solve the issue because it cannot manage the encrypted signatures.

So currently no solution yet.



Re: mytube plugin issues #13 bacicciosat

  • Senior Member
  • 540 berichten

+100
Excellent

Geplaatst op 1 augustus 2013 - 15:50

 

no problem i can post the source of TSmedia-mytube
however it depends on similar file to the file MyTubeService.py on decoding youtube video address
i applied in the past the solution of bacicciosat and no video available message disappeared but as mentioned playing failed
now i do not have example of none available video if one can post example to test
also i am thinking to catch the url from playing the youtube video in pc and compare it with the one decrypted by MyTubeService.py to see where is the difference

 
I don't see in your file a method to decrypt signature.
Are you sure that the video with encrypted signature are working in TS-media ?
just to examples not working in my tube. Search for:
The Gummy Bear Song - Long English Version
Malika Ayane - E se poi - Sanremo 2013

 

If this is your not working video

it is ok in TSmedia
if you have TSmedia you can check TSmedia/Netmedia/youtube/channel feeds/live channels

 

mafaraj

i don't understand why you don't try to understand code and issues instead to post here these wrong things.

You code included in TSmedia is just copyed form Mytube

So what is not working in MyTube is not working in TSmedia.

The video with the key "s" that require a decrypted signature produce the same error both in MyTube and in Tsmedia.

 

Switch to enigma2 debug mode

Run TsMedia plugin

Goto in Youtube

Goto in search

Search for malika

Select video : Malika Ayane - E se poi - Sanremo 2013

Try to play video.

TsMwdia plugin will report: "No video link found" that is the same error of MyTube plugin "No video Available"

And the debug e2 will report exactly the same that MyTube

['itag', '17']
[youtubeUrl] got []


Re: mytube plugin issues #14 mfaraj57

  • Senior Member
  • 1605 berichten

+286
Excellent

Geplaatst op 1 augustus 2013 - 17:14

Nothing wrong posted and i am trying to understand and explain what happening
now through TSmedia youtube search in blackhole vu solo i have message no video available
the same Tsmedia youtube search in cvs image with gp3 no problem in playing the video
through adding the video id to the file merlin oe2.0 image /etc/youtube_user as video:malika:hTCZYZIaxxk and playing from tsmedia/youtube/user channels it is ok

Re: mytube plugin issues #15 raines44

  • Member
  • 4 berichten

0
Neutral

Geplaatst op 16 augustus 2013 - 16:10

Hi all some clever person has manage to fix this problem using a script that automatically works out the correct signatures needed in the youtube plugin for xbmc see the script here https://github.com/r...-dl/issues/1208 can the same method somehow be implemented into the plugin.py file of mytube ?? please see this link for how the script was used to fix the youtubeplayer.py file in xbmc  http://rapidshare.co...ouTubePlayer.py this is not my work all credit goes to dustinbrett on a another forum I have asked if he could help with the mytube plugin but he has no knowledge of mytube so hoping somebody here can work out how to include the script into the plugin.py file of mytube ?? so we can all hopefully have a permanent fix :)


Veranderd door raines44, 16 augustus 2013 - 16:15


Re: mytube plugin issues #16 mx3L

  • Senior Member
  • 616 berichten

+79
Good

Geplaatst op 31 augustus 2013 - 10:02

http://github.com/mx...yTubeService.py



Re: mytube plugin issues #17 littlesat

  • PLi® Core member
  • 56555 berichten

+693
Excellent

Geplaatst op 31 augustus 2013 - 11:37

@mx3L...

 

In between I removed a lot of white spaces...

 

if someone can test this on a DMM box (I do not have one anymore and it only runs on a DMM box)... I can push it.

Bijgevoegde Bestanden


Veranderd door littlesat, 31 augustus 2013 - 11:39

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: mytube plugin issues #18 iseaje

  • Member
  • 16 berichten

0
Neutral

Geplaatst op 31 augustus 2013 - 19:50

@mx3L...

 

In between I removed a lot of white spaces...

 

if someone can test this on a DMM box (I do not have one anymore and it only runs on a DMM box)... I can push it.

 

Thanks little.

 

On DM800SE, it gives this error:

'Some plugins are not availabe:

Extensions/MyTube (__init__() takes exactly 1 argument (4 given))'

 

Hope you can help fix the error.

Thanks.

Iseaje



Re: mytube plugin issues #19 littlesat

  • PLi® Core member
  • 56555 berichten

+693
Excellent

Geplaatst op 31 augustus 2013 - 22:17

The modifications do need a different init file...

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: mytube plugin issues #20 mx3L

  • Senior Member
  • 616 berichten

+79
Good

Geplaatst op 1 september 2013 - 10:41

Just a little clarification:

 

I was not aware that mytube is in openpli repository, since it didn't show up in openpli feeds on my Xtrend (now I know why).

So I used oe-alliance git - https://github.com/o.../master/mytube/ to make this update and just wanted here to share my solution

 

@littlesat

Sorry for inconvenience, I should post more then link.

Its not applicable for mytube in openpli because of more recent version of mytube in oe-alliance.

 

This is latest version of mytube, also with fixed google suggestions (only for DMM) - not tested..

 

Bijlage  plugin.zip   28,9K   132 Aantal bijlagen


Veranderd door mx3L, 1 september 2013 - 10:43



1 gebruiker(s) lezen dit onderwerp

0 leden, 1 bezoekers, 0 anonieme gebruikers