moreginger / xbmc-plugin.video.ted.talks

GNU General Public License v2.0
18 stars 20 forks source link

Playback fails when using non-default bitrate #65

Closed amykyta3 closed 3 years ago

amykyta3 commented 7 years ago

I had my settings set to 600kbps, and keep getting "Playback failed" It looks like the scraper doesn't fall back to a lower bitrate if it is not available. Switched back to 320k since it seems most videos at least have that available.

Attached log. kodi.log.txt

moreginger commented 7 years ago

Your issue is important to us, please hold... :wink:

No seriously, I want to get to the bottom of this but I've been busy trying to get various things cleaned in order to get into the new repos. I do have tests for the URL generation and bitrate scraper (it does fall back if either of these fail), but I suspect what's happening is that something has changed about the exact URLs we need to make. What it doesn't do is test the URL and then fall back if it fails. Is there a way to give Kodi a list of URLs to try? Or perhaps we could just do a really quick urlopen on the stream to see if it looks legit, but I'd rather not. OTOH, that would be an ideal thing to do in tests.

moreginger commented 7 years ago

Based on a small sample it looks like they have changed the URLs available for download (the old suffixes work for older talks).

For example for https://www.ted.com/talks/dan_bricklin_meet_the_inventor_of_the_electronic_spreadsheet the plugin generates a URL of e.g. https://download.ted.com/talks/DanBricklin_2016X-600k.mp4?dnt but the highest quality download is https://download.ted.com/talks/DanBricklin_2016X-480p.mp4

There are streaming URLs for that talk. Maybe Kodi can use those?

GET https://hls.ted.com/talks/2664.m3u8 gives details (where 2664 is the talk ID) GET https://hls.ted.com/talks/2664.json gives intro info that we might currently be scraping (for subtitle offset). Could be useful?

The trickiest thing might be making sure the method works for old and new-style talks.

moreginger commented 7 years ago

FWIW it appears that the 450k link still works, for that talk at least, which might be worth trying as a temporary workaround?

moreginger commented 7 years ago

Tests: https://travis-ci.org/moreginger/xbmc-plugin.video.ted.talks/builds/192880810

moreginger commented 7 years ago

I have a test branch that plays the m3u8 links that are available for newer talks. In theory Kodi could then select the best stream based on your connection speed. However, it doesn't seem to do a very good job of it - it takes 10+ seconds to do anything, sometimes fails, and seems to skip a section at the start of the talk. I'll have to get my ducks in a row and then ask the core team what the issue is.

MartijnKaijser commented 7 years ago

Might need to test again with v17 if it has improved

moreginger commented 3 years ago

We now use m3u8 links (in matrix version).