Ejemplo n.º 1
0
def reset_pm():
    kodi.close_all()
    kodi.sleep(500)  # sleep or reset won't work for some reason
    from urlresolver.plugins import premiumize_me
    pm = premiumize_me.PremiumizeMeResolver()
    pm.reset_authorization()
    kodi.notify(msg=kodi.i18n('pm_auth_reset'), duration=5000)
Ejemplo n.º 2
0
def reset_ls():
    kodi.close_all()
    kodi.sleep(500)  # sleep or reset won't work for some reason
    from urlresolver.plugins import linksnappy
    ls = linksnappy.LinksnappyResolver()
    ls.reset_authorization()
    kodi.notify(msg=kodi.i18n('ls_auth_reset'), duration=5000)
Ejemplo n.º 3
0
def reset_rd():
    kodi.close_all()
    kodi.sleep(500)  # sleep or reset won't work for some reason
    from urlresolver.plugins import realdebrid
    rd = realdebrid.RealDebridResolver()
    rd.reset_authorization()
    kodi.notify(msg=kodi.i18n('rd_auth_reset'), duration=5000)
Ejemplo n.º 4
0
def reset_ad():
    kodi.close_all()
    kodi.sleep(500)  # sleep or reset won't work for some reason
    from urlresolver.plugins import alldebrid
    ad = alldebrid.AllDebridResolver()
    ad.reset_authorization()
    kodi.notify(msg=kodi.i18n('ad_auth_reset'), duration=5000)
Ejemplo n.º 5
0
def reset_pm():
    kodi.close_all()
    kodi.sleep(500)  # sleep or reset won't work for some reason
    from urlresolver.plugins import premiumize_me
    pm = premiumize_me.PremiumizeMeResolver()
    pm.reset_authorization()
    kodi.notify(msg=kodi.i18n('pm_auth_reset'), duration=5000)
Ejemplo n.º 6
0
def reset_ad():
    kodi.close_all()
    kodi.sleep(500)  # sleep or reset won't work for some reason
    from urlresolver.plugins import alldebrid
    ad = alldebrid.AllDebridResolver()
    ad.reset_authorization()
    kodi.notify(msg=kodi.i18n('ad_auth_reset'), duration=5000)
Ejemplo n.º 7
0
def reset_rd():
    kodi.close_all()
    kodi.sleep(500)  # sleep or reset won't work for some reason
    from urlresolver.plugins import realdebrid
    rd = realdebrid.RealDebridResolver()
    rd.reset_authorization()
    kodi.notify(msg=kodi.i18n('rd_auth_reset'), duration=5000)
Ejemplo n.º 8
0
def reset_ub():
    kodi.close_all()
    kodi.sleep(500)  # sleep or reset won't work for some reason
    from urlresolver.plugins import uptobox
    ub = uptobox.UpToBoxResolver()
    ub.reset_authorization()
    kodi.notify(msg=kodi.i18n('ub_auth_reset'), duration=5000)
Ejemplo n.º 9
0
def reset_dl():
    kodi.close_all()
    kodi.sleep(500)  # sleep or reset won't work for some reason
    from urlresolver.plugins import debrid_link
    dl = debrid_link.DebridLinkResolver()
    dl.reset_authorization()
    kodi.notify(msg=kodi.i18n('dl_auth_reset'), duration=5000)
Ejemplo n.º 10
0
 def authorize_resolver(self):
     try:
         logger.log_debug('Debug build 2')
         self.reset_authorization()
         username = self.get_setting('username')
         password = self.get_setting('password')
         if username and password:
             url = 'https://api.alldebrid.com/user/login?agent=%s&username=%s&password=%s' % (
                 AGENT, username, password)
             logger.log_debug('Authorizing AllDebrid')
             js_result = json.loads(self.net.http_GET(url).content)
     except urllib2.HTTPError as e:
         if e.code == 401:
             kodi.notify(msg='Invalid username or password', duration=5000)
             try:
                 js_result = json.loads(e.read())
                 if 'error' in js_result:
                     msg = ('%s (%s)' %
                            (js_result['error'], js_result['errorCode']))
                 else:
                     msg = 'Unknown Error (1)'
             except:
                 msg = 'Unknown Error (2)'
             raise ResolverError('AllDebrid Error: %s (%s)' % (msg, e.code))
         elif e.code == 429:
             kodi.notify(msg='Please login on the Alldebrid website',
                         duration=5000)
             raise ResolverError('AllDebrid Error: blocked login (flood)')
         else:
             raise ResolverError('AllDebrid Error: Unknown Error (3)')
     except Exception as e:
         raise ResolverError('Unexpected Exception during AD Login: %s' %
                             (e))
     else:
         logger.log_debug('Authorizing AllDebrid Result: |%s|' %
                          (js_result))
         if 'error' in js_result:
             raise ResolverError(
                 'AllDebrid Error: %s (%s)' %
                 (js_result['error'], js_result['errorCode']))
         elif js_result['success']:
             self.set_setting('token', js_result['token'])
Ejemplo n.º 11
0
 def get_media_url(self, host, media_id):
     try:
         token = self.get_setting('token')
         url = 'https://api.alldebrid.com/link/unlock?agent=%s&token=%s&link=%s' % (
             AGENT, token, media_id)
         if token:
             result = self.net.http_GET(url).content
     except urllib2.HTTPError as e:
         if e.code == 401:
             try:
                 js_result = json.loads(e.read())
                 if 'error' in js_result:
                     msg = ('%s (%s)') % (js_result['error'],
                                          js_result['errorCode'])
                 else:
                     msg = 'Unknown Error (1)'
             except:
                 msg = 'Unknown Error (2)'
             raise ResolverError('AllDebrid Error: %s (%s)' % (msg, e.code))
         else:
             raise ResolverError('AllDebrid Error: Unknown Error (3)')
     except Exception as e:
         raise ResolverError(
             'Unexpected Exception during AD Unrestrict: %s' % (e))
     else:
         js_result = json.loads(result)
         logger.log_debug('AllDebrid resolve: [%s]' % js_result)
         if 'error' in js_result:
             kodi.notify(msg=js_result['error'], duration=5000)
             raise ResolverError(
                 'AllDebrid Error: %s (%s)' %
                 (js_result['error'], js_result['errorCode']))
         elif js_result['success']:
             if js_result['infos']['link']:
                 return js_result['infos']['link']
             else:
                 raise ResolverError('alldebrid: no stream returned')
         else:
             raise ResolverError('alldebrid: no stream returned')
Ejemplo n.º 12
0
def reset_cache():
    if cache.reset_cache():
        kodi.notify(msg=kodi.i18n('cache_reset'))
    else:
        kodi.notify(msg=kodi.i18n('cache_reset_failed'))
Ejemplo n.º 13
0
def auth_ad():
    kodi.close_all()
    kodi.sleep(500)  # sleep or authorize won't work for some reason
    from urlresolver.plugins import alldebrid
    if alldebrid.AllDebridResolver().authorize_resolver():
        kodi.notify(msg=kodi.i18n('ad_authorized'), duration=5000)
Ejemplo n.º 14
0
def auth_rd():
    kodi.close_all()
    kodi.sleep(500)  # sleep or authorize won't work for some reason
    from urlresolver.plugins import realdebrid
    if realdebrid.RealDebridResolver().authorize_resolver():
        kodi.notify(msg='Real-Debrid Resolver Authorized', duration=5000)
Ejemplo n.º 15
0
def auth_rd():
    kodi.close_all()
    from urlresolver.plugins import realdebrid
    if realdebrid.RealDebridResolver().authorize_resolver():
        kodi.notify(msg='Real-Debrid Resolver Authorized', duration=5000)
Ejemplo n.º 16
0
def auth_pm():
    kodi.close_all()
    kodi.sleep(500)  # sleep or authorize won't work for some reason
    from urlresolver.plugins import premiumize_me
    if premiumize_me.PremiumizeMeResolver().authorize_resolver():
        kodi.notify(msg=kodi.i18n('pm_authorized'), duration=5000)
Ejemplo n.º 17
0
def auth_ub():
    kodi.close_all()
    kodi.sleep(500)  # sleep or authorize won't work for some reason
    from urlresolver.plugins import uptobox
    if uptobox.UpToBoxResolver().authorize_resolver():
        kodi.notify(msg=kodi.i18n('ub_authorized'), duration=5000)
Ejemplo n.º 18
0
def auth_dl():
    kodi.close_all()
    kodi.sleep(500)  # sleep or authorize won't work for some reason
    from urlresolver.plugins import debrid_link
    if debrid_link.DebridLinkResolver().authorize_resolver():
        kodi.notify(msg=kodi.i18n('dl_authorized'), duration=5000)
Ejemplo n.º 19
0
def reset_cache():
    if cache.reset_cache():
        kodi.notify(msg='Cache Reset')
    else:
        kodi.notify(msg='Cache Reset Failed')
Ejemplo n.º 20
0
def reset_rd():
    kodi.close_all()
    from urlresolver.plugins import realdebrid
    rd = realdebrid.RealDebridResolver()
    rd.reset_authorization()
    kodi.notify(msg='Real-Debrid Authorization Reset', duration=5000)
def reset_rd():
    kodi.close_all()
    from urlresolver.plugins import realdebrid
    rd = realdebrid.RealDebridResolver()
    rd.reset_authorization()
    kodi.notify(msg='Real-Debrid Authorization Reset', duration=5000)
def reset_cache():
    if cache.reset_cache():
        kodi.notify(msg='Cache Reset')
    else:
        kodi.notify(msg='Cache Reset Failed')
Ejemplo n.º 23
0
def auth_ls():
    kodi.close_all()
    kodi.sleep(500)  # sleep or authorize won't work for some reason
    from urlresolver.plugins import linksnappy
    if linksnappy.LinksnappyResolver().authorize_resolver():
        kodi.notify(msg=kodi.i18n('ls_authorized'), duration=5000)
def auth_rd():
    kodi.close_all()
    from urlresolver.plugins import realdebrid
    if realdebrid.RealDebridResolver().authorize_resolver():
        kodi.notify(msg='Real-Debrid Resolver Authorized', duration=5000)
Ejemplo n.º 25
0
def auth_ad():
    kodi.close_all()
    kodi.sleep(500)  # sleep or authorize won't work for some reason
    from urlresolver.plugins import alldebrid
    if alldebrid.AllDebridResolver().authorize_resolver():
        kodi.notify(msg=kodi.i18n('ad_authorized'), duration=5000)
Ejemplo n.º 26
0
def auth_pm():
    kodi.close_all()
    kodi.sleep(500)  # sleep or authorize won't work for some reason
    from urlresolver.plugins import premiumize_me
    if premiumize_me.PremiumizeMeResolver().authorize_resolver():
        kodi.notify(msg=kodi.i18n('pm_authorized'), duration=5000)
Ejemplo n.º 27
0
def reset_cache():
    if cache.reset_cache():
        kodi.notify(msg=kodi.i18n('cache_reset'))
    else:
        kodi.notify(msg=kodi.i18n('cache_reset_failed'))
Ejemplo n.º 28
0
def auth_rd():
    kodi.close_all()
    kodi.sleep(500)  # sleep or authorize won't work for some reason
    from urlresolver.plugins import realdebrid
    if realdebrid.RealDebridResolver().authorize_resolver():
        kodi.notify(msg='Real-Debrid Resolver Authorized', duration=5000)