mediafire

package
v4.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addition

type Addition struct {
	driver.RootPath

	SessionToken string `json:"session_token" required:"true" type:"string" help:"Required for MediaFire API"`
	Cookie       string `json:"cookie" required:"true" type:"string" help:"Required for navigation"`

	OrderBy        string  `json:"order_by" type:"select" options:"name,time,size" default:"name"`
	OrderDirection string  `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
	ChunkSize      int64   `json:"chunk_size" type:"number" default:"100"`
	UploadThreads  int     `json:"upload_threads" type:"number" default:"3" help:"concurrent upload threads"`
	LimitRate      float64 `json:"limit_rate" type:"float" default:"2" help:"limit all api request rate ([limit]r/1s)"`
}

type File

type File struct {
	ID         string
	Name       string
	Size       int64
	CreatedUTC string
	IsFolder   bool
}

type FolderContentResponse

type FolderContentResponse struct {
	Folders    []MediafireFolder
	Files      []MediafireFile
	MoreChunks bool
}

type Mediafire

type Mediafire struct {
	model.Storage
	Addition
	// contains filtered or unexported fields
}

func (*Mediafire) Config

func (d *Mediafire) Config() driver.Config

func (*Mediafire) Copy

func (d *Mediafire) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

Copy creates a duplicate of a file or folder in the specified destination directory

func (*Mediafire) Drop

func (d *Mediafire) Drop(ctx context.Context) error

Drop cleans up driver resources

func (*Mediafire) GetAddition

func (d *Mediafire) GetAddition() driver.Additional

func (*Mediafire) GetDetails

func (d *Mediafire) GetDetails(ctx context.Context) (*model.StorageDetails, error)

func (*Mediafire) Init

func (d *Mediafire) Init(ctx context.Context) error

Init initializes the MediaFire driver with session token and cookie validation

func (d *Mediafire) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

Link generates a direct download link for the specified file

func (*Mediafire) List

func (d *Mediafire) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

List retrieves files and folders from the specified directory

func (*Mediafire) MakeDir

func (d *Mediafire) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)

MakeDir creates a new folder in the specified parent directory

func (*Mediafire) Move

func (d *Mediafire) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

Move relocates a file or folder to a different parent directory

func (*Mediafire) Put

Put uploads a file to the specified directory with support for resumable upload and quick upload

func (*Mediafire) Remove

func (d *Mediafire) Remove(ctx context.Context, obj model.Obj) error

Remove deletes a file or folder permanently

func (*Mediafire) Rename

func (d *Mediafire) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)

Rename changes the name of a file or folder

type MediafireActionTokenResponse

type MediafireActionTokenResponse struct {
	Response struct {
		Action            string `json:"action"`
		ActionToken       string `json:"action_token"`
		Result            string `json:"result"`
		CurrentAPIVersion string `json:"current_api_version"`
	} `json:"response"`
}

type MediafireCheckResponse

type MediafireCheckResponse struct {
	Response struct {
		Action          string `json:"action"`
		HashExists      string `json:"hash_exists"`
		InAccount       string `json:"in_account"`
		InFolder        string `json:"in_folder"`
		FileExists      string `json:"file_exists"`
		ResumableUpload struct {
			AllUnitsReady string `json:"all_units_ready"`
			NumberOfUnits string `json:"number_of_units"`
			UnitSize      string `json:"unit_size"`
			Bitmap        struct {
				Count string   `json:"count"`
				Words []string `json:"words"`
			} `json:"bitmap"`
			UploadKey string `json:"upload_key"`
		} `json:"resumable_upload"`
		AvailableSpace       string `json:"available_space"`
		UsedStorageSize      string `json:"used_storage_size"`
		StorageLimit         string `json:"storage_limit"`
		StorageLimitExceeded string `json:"storage_limit_exceeded"`
		UploadURL            struct {
			Simple            string `json:"simple"`
			SimpleFallback    string `json:"simple_fallback"`
			Resumable         string `json:"resumable"`
			ResumableFallback string `json:"resumable_fallback"`
		} `json:"upload_url"`
		Result            string `json:"result"`
		CurrentAPIVersion string `json:"current_api_version"`
	} `json:"response"`
}

type MediafireCopyResponse

type MediafireCopyResponse struct {
	Response struct {
		Action            string   `json:"action"`
		Asynchronous      string   `json:"asynchronous,omitempty"`
		NewQuickKeys      []string `json:"new_quickkeys,omitempty"`
		NewFolderKeys     []string `json:"new_folderkeys,omitempty"`
		SkippedCount      string   `json:"skipped_count,omitempty"`
		OtherCount        string   `json:"other_count,omitempty"`
		Result            string   `json:"result"`
		CurrentAPIVersion string   `json:"current_api_version"`
		NewDeviceRevision int      `json:"new_device_revision"`
	} `json:"response"`
}

type MediafireDirectDownloadResponse

type MediafireDirectDownloadResponse struct {
	Response struct {
		Action string `json:"action"`
		Links  []struct {
			QuickKey       string `json:"quickkey"`
			DirectDownload string `json:"direct_download"`
		} `json:"links"`
		DirectDownloadFreeBandwidth string `json:"direct_download_free_bandwidth"`
		Result                      string `json:"result"`
		CurrentAPIVersion           string `json:"current_api_version"`
	} `json:"response"`
}

type MediafireFile

type MediafireFile struct {
	QuickKey   string `json:"quickkey"`
	Filename   string `json:"filename"`
	Size       string `json:"size"`
	Created    string `json:"created"`
	CreatedUTC string `json:"created_utc"`
	MimeType   string `json:"mimetype"`
}

type MediafireFileSearchResponse

type MediafireFileSearchResponse struct {
	Response struct {
		Action            string `json:"action"`
		FileInfo          []File `json:"file_info"`
		Result            string `json:"result"`
		CurrentAPIVersion string `json:"current_api_version"`
	} `json:"response"`
}

type MediafireFolder

type MediafireFolder struct {
	FolderKey  string `json:"folderkey"`
	Name       string `json:"name"`
	Created    string `json:"created"`
	CreatedUTC string `json:"created_utc"`
}

type MediafireFolderCreateResponse

type MediafireFolderCreateResponse struct {
	Response struct {
		Action            string `json:"action"`
		FolderKey         string `json:"folder_key"`
		UploadKey         string `json:"upload_key"`
		ParentFolderKey   string `json:"parent_folderkey"`
		Name              string `json:"name"`
		Description       string `json:"description"`
		Created           string `json:"created"`
		CreatedUTC        string `json:"created_utc"`
		Privacy           string `json:"privacy"`
		FileCount         string `json:"file_count"`
		FolderCount       string `json:"folder_count"`
		Revision          string `json:"revision"`
		DropboxEnabled    string `json:"dropbox_enabled"`
		Flag              string `json:"flag"`
		Result            string `json:"result"`
		CurrentAPIVersion string `json:"current_api_version"`
		NewDeviceRevision int    `json:"new_device_revision"`
	} `json:"response"`
}

type MediafireLinksResponse

type MediafireLinksResponse struct {
	Response struct {
		Action string `json:"action"`
		Links  []struct {
			QuickKey       string `json:"quickkey"`
			View           string `json:"view"`
			NormalDownload string `json:"normal_download"`
			OneTime        struct {
				Download string `json:"download"`
				View     string `json:"view"`
			} `json:"one_time"`
		} `json:"links"`
		OneTimeKeyRequestCount    string `json:"one_time_key_request_count"`
		OneTimeKeyRequestMaxCount string `json:"one_time_key_request_max_count"`
		Result                    string `json:"result"`
		CurrentAPIVersion         string `json:"current_api_version"`
	} `json:"response"`
}

type MediafireMoveResponse

type MediafireMoveResponse struct {
	Response struct {
		Action            string   `json:"action"`
		Asynchronous      string   `json:"asynchronous,omitempty"`
		NewNames          []string `json:"new_names"`
		Result            string   `json:"result"`
		CurrentAPIVersion string   `json:"current_api_version"`
		NewDeviceRevision int      `json:"new_device_revision"`
	} `json:"response"`
}

type MediafirePollResponse

type MediafirePollResponse struct {
	Response struct {
		Action   string `json:"action"`
		Doupload struct {
			Result      string `json:"result"`
			Status      string `json:"status"`
			Description string `json:"description"`
			QuickKey    string `json:"quickkey"`
			Hash        string `json:"hash"`
			Filename    string `json:"filename"`
			Size        string `json:"size"`
			Created     string `json:"created"`
			CreatedUTC  string `json:"created_utc"`
			Revision    string `json:"revision"`
		} `json:"doupload"`
		Result            string `json:"result"`
		CurrentAPIVersion string `json:"current_api_version"`
	} `json:"response"`
}

type MediafireRemoveResponse

type MediafireRemoveResponse struct {
	Response struct {
		Action            string `json:"action"`
		Asynchronous      string `json:"asynchronous,omitempty"`
		Result            string `json:"result"`
		CurrentAPIVersion string `json:"current_api_version"`
		NewDeviceRevision int    `json:"new_device_revision"`
	} `json:"response"`
}

type MediafireRenameResponse

type MediafireRenameResponse struct {
	Response struct {
		Action            string `json:"action"`
		Asynchronous      string `json:"asynchronous,omitempty"`
		Result            string `json:"result"`
		CurrentAPIVersion string `json:"current_api_version"`
		NewDeviceRevision int    `json:"new_device_revision"`
	} `json:"response"`
}

type MediafireRenewTokenResponse

type MediafireRenewTokenResponse struct {
	Response struct {
		Action            string `json:"action"`
		SessionToken      string `json:"session_token"`
		Result            string `json:"result"`
		CurrentAPIVersion string `json:"current_api_version"`
	} `json:"response"`
}

type MediafireResponse

type MediafireResponse struct {
	Response struct {
		Action        string `json:"action"`
		FolderContent struct {
			ChunkSize   string            `json:"chunk_size"`
			ContentType string            `json:"content_type"`
			ChunkNumber string            `json:"chunk_number"`
			FolderKey   string            `json:"folderkey"`
			Folders     []MediafireFolder `json:"folders,omitempty"`
			Files       []MediafireFile   `json:"files,omitempty"`
			MoreChunks  string            `json:"more_chunks"`
		} `json:"folder_content"`
		Result string `json:"result"`
	} `json:"response"`
}

type MediafireUserInfoResponse

type MediafireUserInfoResponse struct {
	Response struct {
		Action   string `json:"action"`
		UserInfo struct {
			Email           string `json:"string"`
			DisplayName     string `json:"display_name"`
			UsedStorageSize string `json:"used_storage_size"`
			StorageLimit    string `json:"storage_limit"`
		} `json:"user_info"`
		Result            string `json:"result"`
		CurrentAPIVersion string `json:"current_api_version"`
	} `json:"response"`
}

Jump to

Keyboard shortcuts

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