philippe_44 wrote: 
> It's bizarre, there is a whole set of information missing in the webpage
> content that is being returned: "assets": (with " and : included). I ave
> no idea why, but this is where the url to get the js code for signature
> decoding is found. When I use the same track Id, I have this "assets":
> piece of information. So IDK if this is due to your localization,
> something with your project ID where you have not set the key/project
> type. I recommend deleting the whole project on the console and
> restarting from absolute scratch.

I missed this comment originally but that's the clue we needed!  For one
thing, it proves it has nothing to do with API key or Linux
installation. A simple WGET on the video url show indeed that this
"assets": section is not there in the files that fail, and indeed is
clear why they fail when you look inside ProtocoleHandler.pm that relies
on it to get the player url.


Code:
--------------------
    
  # get the player's url
  my ($player_url) = ($content =~ /"assets":.+?"js":\s*("[^"]+")/);
  
  if ( !$player_url ) {
  $log->error("no player url to unobfuscate signature");
  $cb->();
  return;
  
--------------------


It's extacting that js string that follows the assets section, and fails
in that case. But then by comparing both files (one that works and has
the assets tag and one that hasn't), I also noticed that both files have
a jsUrl:  (in fact several) that seem to return the exact same thing. So
I just replaced your code above with the following (I had to refresh my
regex knowledge a bit to be honnest):


Code:
--------------------
    
  # get the player's url
  my ($player_url) = ($content =~ /"jsUrl":\s*("[^"]+")/);
  
--------------------


And now it works, seemingly on both "old" and "new" versions. So maybe
some gradual changes that are hitting some files but not others?

Of course, I am really not familiar with youtube format, so whether we
should replace it in all case, I do not know. Alternatively you could
keep the first version and if it fails try the second?


------------------------------------------------------------------------
dawansv's Profile: http://forums.slimdevices.com/member.php?userid=22248
View this thread: http://forums.slimdevices.com/showthread.php?t=105840

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to