/[projects]/misc/xbmc/plugin.video.todic/default.py
ViewVC logotype

Diff of /misc/xbmc/plugin.video.todic/default.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3264 by torben, Fri Feb 26 12:24:06 2021 UTC revision 3265 by torben, Sat Mar 20 18:35:52 2021 UTC
# Line 3  Line 3 
3    
4  '''  '''
5      Todic plugin for XBMC      Todic plugin for XBMC
6      Version 1.9.3      Version 1.9.4
7  '''  '''
8    
9  import sys  import sys
# Line 18  import xbmcplugin Line 18  import xbmcplugin
18  import urllib  import urllib
19  import urllib.request  import urllib.request
20    
21    import platform
22    
23  # import pprint  # import pprint
24    
25  from xml.dom.minidom import parseString  from xml.dom.minidom import parseString
# Line 198  def SaveFile(path, data): Line 200  def SaveFile(path, data):
200    
201    
202  def open_url(url):  def open_url(url):
203      with urllib.request.urlopen(url) as req:      kodi_ver = xbmc.getInfoLabel('System.BuildVersion')
204        reqobj = urllib.request.Request(
205            url,
206            data=None,
207            headers={
208                'User-Agent': 'TodicKodi:' + str(__addon__.getAddonInfo('version')) + " Kodi:" + str(kodi_ver) + " Platform:" + str(platform.system()) + " " + str(platform.release())
209            }
210        )
211    
212        with urllib.request.urlopen(reqobj) as req:
213          #data = response.read()          #data = response.read()
214          #return data          #return data
215          charset=req.info().get_content_charset()          charset=req.info().get_content_charset()

Legend:
Removed from v.3264  
changed lines
  Added in v.3265

  ViewVC Help
Powered by ViewVC 1.1.20