Release NPR Music Video Addon
#16
Hi there,

3.0.5 still fails for me at start:

Logs:

https://pastebin.com/VtPg9GvJ
Reply
#17
Not a full debug log, but I'm guessing that you are outside the US and this add-on will not work in some areas outside of the US.
Reply
#18
You are right, I'm not in USA, but this add-on was working till some months ago without any problem. Is NPR not available now for the rest of the world? 

Anyway, my full log:
https://paste.kodi.tv/imuhetojuq

Thanks for your work
Reply
#19
No idea. All I can tell you is it works with no problems from the US.
Reply
#20
I was trying to find the source code in github, but I get lost with so many forks. Can you provide me a link to get a look in the code? (for kodi-krypton). 

Thanks
Reply
#21
https://github.com/learningit/repo-plugi....video.npr
Reply
#22
You were right: The add-on works normally when using a VPN connected to USA.
Reply
#23
Please, no discussions on circumventing geoblocking, as per the vpn policy (wiki).
Search | Banned addons (wiki) | Forum rules (wiki) | First time user (wiki) | FAQs (wiki) | Troubleshooting (wiki) | Add-ons (wiki) | Free content (wiki) | Debug log (wiki)Free Content
Reply
#24
Good to know. I just trying to debug why this extension stopped to work because I didn't find any info about NPR blocking its content to other countries.

So, my intention was to give feedback to the developer if someone else complains/report something similar. I listen to NPR via youtube now by the way.
Reply
#25
Version 4.0.0 is available in the v19 repo.
Note that this is a py3 native add-on and will only work with Kodi v19 or above.

This is a pretty full rewrite and adds content from NPR Live Sessions which provides videos from live concerts or sessions. Nearly all videos are 1080 HD.
The Live Sessions selection allows the user to Browse Artists, Playlists, watch live concerts and Search for videos and artists.

When a video link is displayed the context menu allows you to see Artist info, see Related Artists and add the video to the Music Video Library.

The directory containing the music video .strm and .nfo files is located at 'userdata/addon_data/script.module.t1mlib/music_videos/'.
You need to set this directory as a video source setting the content type to 'Music Videos'.
The video and metadata files are grouped under the Artist folder.

There are quite a few issues with Music Videos currently in Kodi, but this is a start and we'll see how to improve things as we go along.
The metadata for Artist and Album will fill in if you have that Artist and Album in your Music Library. If not, the art and bio info will not be displayed but the info and images for the video will display when you browse to the actual video link.

The NPR Live Sessions is in partnership with Vuhaus and is full of up and coming artists as well as many not well known or alternative artists. You can browse Artists alphabetically or search for them.

The Watch Live selection will display the artist and the date and time of the session in your locale's time. Selecting the link before the date and time given will return an error currently.
Reply
#26
I tried the Matrix version of the NPR music video plugin today. I navigated to the "Tiny Desk Concerts" page, but couldn't play any videos there. Looking closer, getAddonVideo() didn't find any playable video on the corresponding HTML page.

The reason is that me being in the EU caused npr.org to return a GDPR consent page instead of the "real" page. The first two hunks in patch below get around this by sending an appropriate cookie.
With this applied, the correct url for the video was extracted (as finalurl="https://cdn.jwplayer.com/manifests/9S7DcHUZ.m3u8"), but it still didn't play, as it got the wrong mimetype.
The third hunk below fixes that.

diff --git a/plugin.video.npr/resources/lib/scraper.py b/plugin.video.npr/resources/lib/scraper.py
index bafabfb2..60083647 100644
--- a/plugin.video.npr/resources/lib/scraper.py
+++ b/plugin.video.npr/resources/lib/scraper.py
@@ -6,6 +6,7 @@ import json
 import re
 import os
 from datetime import datetime
+import time
 import xbmc
 import xbmcplugin
 import xbmcgui
@@ -201,8 +202,14 @@ class myAddon(t1mAddon):
 
 
   def getAddonVideo(self,url):
+   gdpr_cookies = {
+        "trackingChoice": "true",
+        "choiceVersion": "1",
+        "dateOfChoice": "{:.0f}".format(time.time())
+    }
+
    if not url.endswith('.m3u8'):
-      html = requests.get(url, headers=self.defaultHeaders).text
+      html = requests.get(url, headers=self.defaultHeaders, cookies=gdpr_cookies).text
       a = re.compile("data-jwplayer='(.+?)'>", re.DOTALL).search(html)
       if a is not None:
            a = json.loads(a.group(1))
@@ -226,7 +233,7 @@ class myAddon(t1mAddon):
    else:
        finalurl = url
    liz = xbmcgui.ListItem(path=finalurl, offscreen=True)
-   if url.endswith('.m3u8'):
+   if finalurl.endswith('.m3u8'):
       liz.setProperty('inputstream','inputstream.adaptive')
       liz.setProperty('inputstream.adaptive.manifest_type','hls')
       liz.setMimeType('application/x-mpegURL')
Reply
#27
I'm running Kodi on a Raspberry Pi 4B running an up-to-date Raspberry Pi OS (64bit). The add-on (v4.01) isn't working for me - just gives a Kodi error and, of course, the logs contain nothing of interest even though I've set them to warning & above.

Help would be appreciated.
Reply
#28
Yup. The NPR music addon is screwed up again. I'll try to fix it this weekend.
Reply
#29
Thanks. Given that it's been 4 years since the last post, your code has had a pretty good run.
Reply

Logout Mark Read Team Forum Stats Members Help
NPR Music Video Addon0
This forum uses Lukasz Tkacz MyBB addons.