xl

package
v0.0.0-...-b256418 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2013 License: MIT, MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOMAIN_LIXIAN       = "http://dynamic.cloud.vip.xunlei.com/"
	TASK_BASE           = DOMAIN_LIXIAN + "user_task?userid=%s" //G_USERID
	TASK_HOME           = DOMAIN_LIXIAN + "user_task?userid=%s&st=4"
	TASK_PAGE           = DOMAIN_LIXIAN + "user_task?userid=%s&st=%s&p=%s" //"G_USERID,G_STATUS,G_PAGENUM
	HISTORY_HOME        = DOMAIN_LIXIAN + "user_history?userid=%s"
	EXPIRE_HOME         = DOMAIN_LIXIAN + "user_history?type=1&userid=%s"
	HISTORY_PAGE        = DOMAIN_LIXIAN + "user_history?userid=%s&p=%d"
	APPLY_HOME          = DOMAIN_LIXIAN + "user_apply?userid=%s"
	APPLY_PAGE          = DOMAIN_LIXIAN + "user_apply?userid=%s&p=%s"
	LOGIN_URL           = DOMAIN_LIXIAN + "login"
	INTERFACE_URL       = DOMAIN_LIXIAN + "interface"
	TASKDELAY_URL       = INTERFACE_URL + "/task_delay?taskids=%s&interfrom=%s&noCacheIE=%d"
	GETTORRENT_URL      = INTERFACE_URL + "/get_torrent?userid=%s&infoid=%s"
	TASKPAUSE_URL       = INTERFACE_URL + "/task_pause?tid=%s&uid=%s&noCacheIE=%d"
	REDOWNLOAD_URL      = INTERFACE_URL + "/redownload?callback=jsonp%d"
	SHOWCLASS_URL       = INTERFACE_URL + "/show_class?callback=jsonp%d&type_id=%d"
	MENUGET_URL         = INTERFACE_URL + "/menu_get"
	FILLBTLIST_URL      = INTERFACE_URL + "/fill_bt_list?callback=fill_bt_list&tid=%s&infoid=%s&g_net=1&p=1&uid=%s&interfrom=%s&noCacheIE=%d"
	TASKCHECK_URL       = INTERFACE_URL + "/task_check?callback=queryCid&url=%s&interfrom=task&random=%s&tcache=%d"
	TASKCOMMIT_URL      = INTERFACE_URL + "/task_commit?"
	BATCHTASKCOMMIT_URL = INTERFACE_URL + "/batch_task_commit?callback=jsonp%d"
	TORRENTUPLOAD_URL   = INTERFACE_URL + "/torrent_upload"
	BTTASKCOMMIT_URL    = INTERFACE_URL + "/bt_task_commit?callback=jsonp%d"
	URLQUERY_URL        = INTERFACE_URL + "/url_query?callback=queryUrl&u=%s&random=%s"
	DELAYONCE_URL       = INTERFACE_URL + "/delay_once?callback=anything"
	RENAME_URL          = INTERFACE_URL + "/rename?"
	TASKPROCESS_URL     = INTERFACE_URL + "/task_process?callback=jsonp%d&t=%d"
	TASKDELETE_URL      = INTERFACE_URL + "/task_delete?callback=jsonp%d&type=%d&noCacheIE=%d"
	SHOWTASK_UNFRESH    = INTERFACE_URL + "/showtask_unfresh?type_id=%d&page=%d&tasknum=%s&p=%d&interfrom=task"
)

Variables

View Source
var ReuseSession error
View Source
var XLTASK_HOME string

Functions

func AssertTaskId

func AssertTaskId(taskid string) bool

func EncryptPass

func EncryptPass(pass string) string

Types

type Agent

type Agent struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(c Config) *Agent

func (*Agent) AddBatchTasks

func (this *Agent) AddBatchTasks(urls []string) error

func (*Agent) AddTask

func (this *Agent) AddTask(req string) error

supported uri schemes: 'ed2k', 'http', 'https', 'ftp', 'bt', 'magnet', 'thunder', 'Flashget', 'qqdl'

func (*Agent) DelayTask

func (this *Agent) DelayTask(taskid string) error

func (*Agent) DeleteTask

func (this *Agent) DeleteTask(taskid string) error

func (*Agent) DeleteTasks

func (this *Agent) DeleteTasks(ids []string) error

func (*Agent) Dispatch

func (this *Agent) Dispatch(pattern string, flag int) ([]string, error)

func (*Agent) Download

func (this *Agent) Download(taskid string, filter string, fc Fetcher, echo bool) error

func (*Agent) FillBtList

func (this *Agent) FillBtList(taskid string) (*_bt_list, error)

func (*Agent) GetTorrentByHash

func (this *Agent) GetTorrentByHash(hash, file string)

func (*Agent) InfoTasks

func (this *Agent) InfoTasks(id interface{})

func (*Agent) IsOn

func (this *Agent) IsOn() bool

func (*Agent) Login

func (this *Agent) Login() error

func (*Agent) PauseTasks

func (this *Agent) PauseTasks(ids []string) error

func (*Agent) ProcessTask

func (this *Agent) ProcessTask() error

func (*Agent) PurgeTask

func (this *Agent) PurgeTask(taskid string) error

func (*Agent) ReAddAllExpiredTasks

func (this *Agent) ReAddAllExpiredTasks() error

func (*Agent) RenameTask

func (this *Agent) RenameTask(taskid, newname string) error

func (*Agent) RestartTasks

func (this *Agent) RestartTasks(pattern string) error

func (*Agent) SetPass

func (this *Agent) SetPass()

func (*Agent) ShowDeletedTasks

func (this *Agent) ShowDeletedTasks(show bool) error

func (*Agent) ShowExpiredTasks

func (this *Agent) ShowExpiredTasks(show bool) error

func (*Agent) ShowTasks

func (this *Agent) ShowTasks() error

func (*Agent) UsePassReader

func (this *Agent) UsePassReader(p PassReader)

type Aria2

type Aria2 struct {
}

func (Aria2) Fetch

func (a Aria2) Fetch(uri, gdriveid, filename string, echo bool) error

type Config

type Config interface {
	GetId() string
	GetPass() string
	SetPass(string) error
	Boost() bool
}

type Fetcher

type Fetcher interface {
	Fetch(uri, gdriveid, filename string, echo bool) error
}
var DefaultFetcher Fetcher

type PassReader

type PassReader interface {
	ReadPassword() (string, error)
}
var DefaultPassReader PassReader
var FilePassReader PassReader

type Task

type Task interface {
	Task() *XLTask
	CloneTask() XLTask
}

type XLTask

type XLTask struct {
	Id       string  // task id
	Name     string  // task name
	Type     string  // task type, bt or nonbt
	Cat      string  // user defined catagory, not used currently
	Flag     string  // normal, expired, or deleted
	Status   string  // downloading, pending, paused, completed, failed
	Progress float32 // downloading progress
	Speed    string
	Life     string
	URL      string // original url
	DownURL  string // downloadable url
	Hash     string // cid, infohash of bt
	Cookie   string
	Size     string
	Length   string
	Uid      int
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL