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)
Exemple #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)
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)
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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
 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'])
 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')
Exemple #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'))
Exemple #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)
Exemple #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)
Exemple #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)
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)
Exemple #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)
Exemple #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)
Exemple #19
0
def reset_cache():
    if cache.reset_cache():
        kodi.notify(msg='Cache Reset')
    else:
        kodi.notify(msg='Cache Reset Failed')
Exemple #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')
Exemple #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)
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)
Exemple #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)
def reset_cache():
    if cache.reset_cache():
        kodi.notify(msg=kodi.i18n('cache_reset'))
    else:
        kodi.notify(msg=kodi.i18n('cache_reset_failed'))
Exemple #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)