core

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: GPL-3.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

View Source
const UserAgent string = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36"

UserAgent is a customer browser user agent used in every HTTP connections

Variables

This section is empty.

Functions

func DlFileWithoutChrome

func DlFileWithoutChrome(fileURL string, in string, client *http.Client) (string, error)

DlFileWithoutChrome downloads the torrent with a custom client created by user and returns the path of downloaded file. The name of the downloaded file is made up of the search arguments + the Unix timestamp to avoid collision. Ex: comte_de_montecristo_1581064034469619222.torrent

func Fetch

func Fetch(ctx context.Context, url string, cookies []*http.Cookie) (string, []*http.Cookie, error)

Fetch opens a url with custom context and cookies passed by the caller. It uses ChromeDP under the hood in order to emulate a real browser running on Pixel 2 XL, and thus properly handle Javascript.

func FetchWithoutChrome

func FetchWithoutChrome(url string, client *http.Client) (string, *http.Client, error)

FetchWithoutChrome fetches a URL using Go http client under the hood instead of Chrome.

Types

This section is empty.

Jump to

Keyboard shortcuts

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