arc

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: 9 Imported by: 1

README

Description of the Archive.org scraping library

arc searches torrents on Archive.org

See here the Go documentation of this library.

The Lookup function searches Archive.org and returns a clean list of torrents. For each torrent the following info is retrieved:

  • name
  • description page

The FindAndDlFile function opens a torrent description page, retrieves the torrent file url, and downloads the torrent file.

Documentation

Overview

Package arc searches and downloads archive.org

No check is done here regarding the user input. This check should be achieved by the caller. Parsing is achieved thanks to the GoQuery library.

Torrent search is achieved by Lookup(). Input is a search string. Output is a slice of maps made up of the following keys:

- DescUrl: the torrent description dedicated url

- Name: the torrent name

Torrent url extraction and torrent file download are achieved by FindAndDlFile(). Input is the url of the torrent page. Output is the local path where the torrent file was downloaded.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAndDlFile

func FindAndDlFile(descURL string, in string, timeout time.Duration) (string, error)

FindAndDlFile opens the torrent description page and downloads the torrent file. A user timeout is set. Returns the local path of downloaded torrent file.

Types

type Torrent

type Torrent struct {
	// Description url containing more info about the torrent including the torrent file address
	DescURL string
	Name    string
}

Torrent contains meta information about the torrent

func Lookup

func Lookup(in string, timeout time.Duration) ([]Torrent, error)

Lookup takes a user search as a parameter, launches the http request with a custom timeout, and returns clean torrent information fetched from archive.org

Jump to

Keyboard shortcuts

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