cguZZman / plugin.googledrive

The Google Drive addon for Kodi
GNU General Public License v3.0
211 stars 71 forks source link

External players not supported anymore? #182

Closed jmiskinis closed 3 years ago

jmiskinis commented 3 years ago

Describe the bug I used to be able to play videos in their original quality using external video players, such as MX Player. It seems that it's no longer possible, though I still can play videos if I select other quality options. Kodi's default player works without any issues.

To Reproduce

  1. Modify Kodi's playercorefactory.xml to include MX Player.
  2. Right click on a video in Kodi and select "Play using" -> MX Player.
  3. Video doesn't play.

Your debug log file Kodi's log: https://paste.kodi.tv/kihacolone.kodi MX Player Pro log excerpt: https://paste.kodi.tv/meyidizuhu

Looking at MX Player Pro's log I can see the following:

09-11 06:09:48.008 17974 17974 V MX.Screen/Dump: onCreate (com.mxtech.videoplayer.pro.ActivityScreen@e5f1cfc)
09-11 06:09:48.008 17974 17974 V MX.Screen/Dump: * data=https://www.googleapis.com/drive/v3/files/1hH3hmI8q9bxqW_xN4SK82rv_jg0d4SOQ?alt=media|Authorization=Bearer%20ya29.a0AfH6SMCvzFEa7o2NmYOfNcDOXowRm_NNejA2FB8oTmStW_RSxrFnQSzXIBoF5zCXlFK4_Sg7xJXC7g0rD5gETOxrNt1jWJk_hWSSWSN-uaJgyMtwe6y48Y7X8-wLg0z4ozRBnHh1WNkSNR-4j2mzzUMbJRyfMw9LdWL92A
09-11 06:09:48.008 17974 17974 V MX.Screen/Dump: * type=video/*
09-11 06:09:48.008 17974 17974 V MX.Screen/Dump: * Package=com.mxtech.videoplayer.pro
09-11 06:09:48.008 17974 17974 V MX.Screen/Dump: * Component=ComponentInfo{com.mxtech.videoplayer.pro/com.mxtech.videoplayer.ActivityScreen$WebDelegate}
09-11 06:09:48.008 17974 17974 V MX.Screen/Dump: * Flags=268435456
...
...
...
09-11 06:09:48.505 17974 21228 W *MX.FFmpeg: HTTP error 403 Forbidden
09-11 06:09:48.506 17974 21228 E *MX.FFFormat: Failed to open 'https://www.googleapis.com/drive/v3/files/1hH3hmI8q9bxqW_xN4SK82rv_jg0d4SOQ?alt=media'. status=-858797304
09-11 06:09:48.507 17974 21228 E *MX.FFReader: AVException caught. error=-858797304
09-11 06:09:48.507 17974 17974 E MX.Player.FF: Error (1,-858797304)
09-11 06:09:48.507 17974 17974 E MX.Player.Joint: [1] error: what=1 extra=-858797304
09-11 06:09:48.507 17974 17974 E MX.Player.FF: can not be called before prepared
09-11 06:09:48.508 17974 17974 V MX.Player.FF: === Begin closing soft player
09-11 06:09:48.508 17974 17974 V MX.Player.FF: === End closing soft player
...
...
...
09-11 06:09:48.515 17974 17974 W MediaPlayer: Couldn't open https://www.googleapis.com/...
09-11 06:09:48.515 17974 17974 W MediaPlayer: java.io.FileNotFoundException: No content provider: https://www.googleapis.com/drive/v3/files/1hH3hmI8q9bxqW_xN4SK82rv_jg0d4SOQ?alt=media
09-11 06:09:48.515 17974 17974 W MediaPlayer:   at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1680)

HTTP error 403 Forbidden seems interesting. Could it be due to changes in Drive API?

cguZZman commented 3 years ago

Yes. It is due to changes in Drive API. Now an http auth header must be send to request the video file from google. Kodi's player allows to request a URL and also specify the header.