Git Product home page Git Product logo

go-strikeapi's Introduction

Strike API client

GoDoc

This is a wrapper around the Strike API v2 (https://getstrike.net/) written in go and based on their documentation documentation

Search Torrents

	// Search, SearchWithCategory and SearchWithCategoryAndSubCategory will search torrents
	torrentList, err = strikeapi.SearchWithCategory("Slackware 14.1 x86_64 DVD ISO", strikeapi.Applications)
	for _, t := range torrentList {
		log.Printf("Got : %+v", t)
	}

Get informations from torrent hash

	// Get torrent informations by its hash
	torrent, err := strikeapi.GetTorrentInfos("B425907E5755031BDA4A8D1B6DCCACA97DA14C04")
	if err != nil {
		log.Fatal("Got error : ", err)
	}
	log.Printf("Informations about the Torrent : %+v", torrent)

	// Get torrents informations by a list of hashes
	torrentList, err := strikeapi.GetTorrentsInfos([]string{"B425907E5755031BDA4A8D1B6DCCACA97DA14C04", "156B69B8643BD11849A5D8F2122E13F"})
	if err != nil {
		log.Fatal("Got error : ", err)
	}
	for _, t := range torrentList {
		log.Printf("Informations about the Torrent : %+v", t)
	}

Get Description of a torrent

	// GetDescription will return the description of a given hash or of a given torrent
	desc, err := strikeapi.GetDescription("B425907E5755031BDA4A8D1B6DCCACA97DA14C04")
	if err != nil {
		log.Fatal("Got error : ", err)
	}
	// And the equivalent method on a Torrent object :
	desc, err = torrent.GetDescription()
	if err != nil {
		log.Fatal("Got error : ", err)
	}
	log.Printf("Description : %s", desc)

Get Download link

	// GetDownloadLink will return the download link of a .torrent of a given hash or of a given torrent
	downloadLink, err := strikeapi.GetDownloadLink("B425907E5755031BDA4A8D1B6DCCACA97DA14C04")
	if err != nil {
		log.Fatal("Got error : ", err)
	}
	// And the equivalent method on a Torrent object :
	downloadLink, err = torrent.GetDownloadLink()
	if err != nil {
		log.Fatal("Got error : ", err)
	}
	log.Printf("Download link : %s", downloadLink)

Get the number of indexed torrents

	// Get how many torrents are indexed
	torrentNb, err := strikeapi.CountTorrents()
	if err != nil {
		log.Fatal("Got error : ", err)
	}
	log.Printf("Number of Torrents indexed : %+v", torrentNb)

go-strikeapi's People

Contributors

pouulet avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.