mega

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mega contains functions that can be used to accurately extract and validate Mega links.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delegate

func Delegate(res, source string) ([]models.Entry, error)

Delegate takes a string as an argument and returns a slice of valid Mega links found within the response (if any) and an error

func Extract

func Extract(res string) ([]string, error)

Extract returns a slice of all Mega links contained within a string, if any.

func ExtractFileCount

func ExtractFileCount(megaContents string) int

ExtractFileCount takes the body response/contents of a Mega page (raw source/html (formatted as string)) as an argument and returns the file count as an integer. It will return -1 in the case of a syntax error. This will only work on Mega folders and not Mega files.

func ExtractSize

func ExtractSize(megaContents string) string

ExtractSize takes the body response/contents of a Mega page (raw source/html (formatted as string)) as an argument and returns the total/cumulative file/folder size as a string.

func Validate

func Validate(x string) (bool, error)

Validate takes a Mega link/URL and passes it to the Mega API to check whether or not it is online.

Types

This section is empty.

Jump to

Keyboard shortcuts

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