Exemplo n.º 1
0
import urllib,urllib2
import os
import xbmc,xbmcplugin,xbmcgui,xbmcaddon
import getlink
import simplejson as json
from config import VIETMEDIA_HOST
from addon import alert, notify, ADDON, ADDON_ID, ADDON_PROFILE
from platform import PLATFORM
import uuid

reload(sys);
sys.setdefaultencoding("utf8")

HANDLE = int(sys.argv[1])

CURRENT_PATH = ADDON.getAddonInfo("path")
PROFILE_PATH = xbmc.translatePath(ADDON_PROFILE).decode("utf-8")

VERSION = ADDON.getAddonInfo("version")
USER = ADDON.getSetting('user_id')
USER_PIN_CODE = ADDON.getSetting('user_pin_code')

def fetch_data(url, headers=None):
  visitor = get_visitor()
  if headers is None:
    headers = { 
                'User-agent'    : 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36 VietMedia/1.0',
                'Referers'      : 'http://www..google.com',
                'X-Visitor'     : visitor,
                'X-Version'     : VERSION,
                'X-User'        : USER,
Exemplo n.º 2
0
from addon import alert, notify,notify1, TextBoxes, ADDON, ADDON_ID, ADDON_PROFILE, LOG, PROFILE
import json
import random
import xbmc,xbmcgui
import pyxbmct
from config import VIETMEDIA_HOST
import urllib
import os, sys
#import requests
import time
import vmfdecode as vmf
#import urlresolver


USER_VIP_CODE = ADDON.getSetting('user_vip_code')
ADDON_NAME = ADDON.getAddonInfo("name")
PROFILE_PATH = xbmc.translatePath(ADDON_PROFILE).decode("utf-8")
T='aHR0cDovL3BsYXllci50cnVuZ3VpdC5uZXQvZ2V0P3VybD0='
F1 = 'U2FsdGVkX18tMUoo3k2cYautKONoQ5xHCpLDHBz/RNhTLRbBvHKgrtMKiRks5tw4'
HOME = xbmc.translatePath('special://home/')
USERDATA = os.path.join(xbmc.translatePath('special://home/'), 'userdata')
ADDONDATA = os.path.join(USERDATA, 'addon_data', ADDON_ID)
DIALOG = xbmcgui.Dialog()
vDialog = xbmcgui.DialogProgress()

def fetch_data(url, headers=None, data=None):
  	if headers is None:

  		headers = { 
    				'User-agent'	: 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36 VietMedia/1.0',
                	'Referer'		: 'http://www.google.com',
Exemplo n.º 3
0
import uuid
import SimpleDownloader as downloader
import remove_accents
import autorun
import datetime as dt, time
import xbmcvfs, shutil, zipfile


downloader = downloader.SimpleDownloader()

reload(sys);
sys.setdefaultencoding("utf8")

HANDLE = int(sys.argv[1])

CURRENT_PATH = ADDON.getAddonInfo("path")
PROFILE_PATH = xbmc.translatePath(ADDON_PROFILE).decode("utf-8")
VERSION = ADDON.getAddonInfo("version")
USER = ADDON.getSetting('user_id')
ADDON_NAME = ADDON.getAddonInfo("name")
USER_PIN_CODE = ADDON.getSetting('user_pin_code')
USER_VIP_CODE = ADDON.getSetting('user_vip_code')
LOCK_PIN = ADDON.getSetting('lock_pin')
VIEWMODE = ADDON.getSetting('view_mode')
DOWNLOAD_PATH = ADDON.getSetting("download_path")
CHECK = ADDON.getSetting("check")
DIALOG = xbmcgui.Dialog()
vDialog = xbmcgui.DialogProgress()
HOME = xbmc.translatePath('special://home/')
USERDATA = os.path.join(xbmc.translatePath('special://home/'), 'userdata')
ADDONDATA = os.path.join(USERDATA, 'addon_data', ADDON_ID)