ZionDevelopers / playx

In-game Internet (YouTube, Twitch, SoundCloud, mp4 and etc.) media player for Garry's Mod
http://steamcommunity.com/sharedfiles/filedetails/?id=106516163
Other
18 stars 14 forks source link

Youtube Metadata(not the search) still uses old youtube API #82

Closed adosikas closed 9 years ago

adosikas commented 9 years ago

The queryed metadata via http://gdata.youtube.com/feeds/api/videos/ is displaying the deprecation video, this does affects the wire outputs.

The new API seems to have a equivalent here: https://developers.google.com/youtube/v3/docs/videos/list

juliocoliveira commented 9 years ago

No is not, As you can see on https://github.com/ZionDevelopers/playx/blob/master/lua/autorun/server/playx_media_query.lua#L92 Make sure you are using an Updated version.

adosikas commented 9 years ago

Not the search, i refer to the metadata used to populate the wire outputs (title, duration, views, ...).

https://github.com/ZionDevelopers/playx/blob/master/lua/playx/providers/youtube.lua#L91

juliocoliveira commented 9 years ago

Well i don't have time to research on youtube api to re-implement this again, since i did not made this implementation.

But @SwadicalRag did the last youtube api upgrade just a few days ago, you could ask to he fix it.

SwadicalRag commented 9 years ago

I totally forgot about fixing metadata on my initial commit. Sorry!

It should be fixed in the PR I sent.

juliocoliveira commented 9 years ago

I tested, and worked fine but it gives the error:

[ERROR] addons/playx/lua/playx/providers/youtube.lua:128: attempt to index field
 'standard' (a nil value)
  1. onsuccess - addons/playx/lua/playx/providers/youtube.lua:128
   2. unknown - lua/includes/modules/http.lua:34

@SwadicalRag can you fix it?

SwadicalRag commented 9 years ago

What video was playing when that error occured?

I quickly skimmed the code, and there is no table called "standard", nor is anything called "standard" being indexed.

I'm a bit confused :s

juliocoliveira commented 9 years ago

I don't know, i played a lot of videos. https://github.com/ZionDevelopers/playx/blob/master/lua/playx/providers/youtube.lua#L128

adosikas commented 9 years ago

Should probably be "default" in that line, not "standard" Excerpt of a API result for example

"snippet": {
  [...]
  "thumbnails": {
   "default": {
    "url": "https://i.ytimg.com/vi/JVSZwOpKVCY/default.jpg"
   },
   "medium": {
    "url": "https://i.ytimg.com/vi/JVSZwOpKVCY/mqdefault.jpg"
   },
    "high": {
    "url": "https://i.ytimg.com/vi/JVSZwOpKVCY/hqdefault.jpg"
   }
  },
  [...]
 }
SwadicalRag commented 9 years ago

Ah, a simple control+F didn't work when i tried it.

@adosikas is correct, 'standard' was apparently undefined in that api call, whilst 'default' will always be defined.

I'm not near my computer at the moment, so I can't make any changes myself.