Giter Club home page Giter Club logo

gotorrent's Introduction

Hi there ๐Ÿ‘‹

I'm a computer engineer from Uruguay. I'm always learning new stuff, hacking away on useless open source projects of my own, and occasionally contributing to useful projects made by other people.

๐Ÿฑโ€๐Ÿ’ป Currently hacking on

  • gotorrent, a TUI for searching torrents implemented in Go.
  • I'm always looking to collaborate on cool stuff. Hit me up!

About me

  • ๐Ÿข I'm a Tech Lead at Mercado Libre.
  • ๐Ÿ’ป neovim is my editor of choice while not using Java.
  • โค In love with Go and Rust.
  • ๐Ÿง I use Linux (Manjaro) with i3.
  • ๐Ÿ’ช๐Ÿป I'm active on StackOverflow, where I'm one of the top 10% answerers in React, JavaScript, and Python.

๐Ÿ“ซ Contact me

You can find me on LinkedIn. Feel free to send me a connection request!

Stats

gotorrent's People

Contributors

ismaelpadilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ayuryshev

gotorrent's Issues

Add configuration management

It should be possible to set values for different flags by having a configuration file in the .config folder.

Remove ability to interact with indexes out of bounds

If the torrent list has 99 torrents, one can type 100 and press enter, and this will produce an error that crashes de application. This should be fixed to show an error message, or prevent the ability to type 100 or press enter altogether.

Search cursor doesn't blink

While in search mode (press s), the cursor should blink, but it doesn't. Likely related to the fact that the input is inside a viewport, it may be necessary to change the way the viewport updates.

Show appropriate message when search query doesn't match with any torrents

When the search query leads to no results being found, the torrent table is still printed, and it is possible to select the "fake" No results returned row:

  No.                                                            Title      Size    S    L Uploaded
>   0                                              No results returned     0.00B    0    0 1969-12-31

This is because the torrent api returns the following when a query doesn't match with any torrents (i.e. https://apibay.org/q.php?q=):

[{"id":"0","name":"No results returned","info_hash":"0000000000000000000000000000000000000000","leechers":"0","seeders":"0","num_files":"0","size":"0","username":"","added":"0","status":"member","category":"0","imdb":"","total_found":"1"}]

This special case should be handled, and an appropriate message should be shown.

Unable to show files

Arch linux 6.0.12
gotorrent 0.1.2-1 (installed through the aur)

Expected behavior: Displaying the files of the highlighted torrent

Console output:

Caught panic:

cant unmarshalljson: cannot unmarshal object into Go struct field pirateBayTorrentFile.Name of type []string

Restoring terminal...

2022/12/14 15:49:22 cant unmarshalljson: cannot unmarshal object into Go struct field pirateBayTorrentFile.Name of type []string
goroutine 1 [running]:
runtime/debug.Stack()
	/opt/hostedtoolcache/go/1.18.5/x64/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
	/opt/hostedtoolcache/go/1.18.5/x64/src/runtime/debug/stack.go:16 +0x19
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func3()
	/home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:371 +0x95
panic({0x8267c0, 0xc003a26210})
	/opt/hostedtoolcache/go/1.18.5/x64/src/runtime/panic.go:844 +0x258
log.Panic({0xc0001be8d8?, 0x36?, 0x200?})
	/opt/hostedtoolcache/go/1.18.5/x64/src/log/log.go:385 +0x65
github.com/ismaelpadilla/gotorrent/clients/thepiratebay.pirateBay.FetchTorrentFiles({}, {{0x96b998, 0xc392e8}, {0xc000e09558, 0x7}, {0xc000b397d0, 0x2b}, {0x0, 0x0}, {0xc000b39800, ...}, ...})
	/home/runner/work/gotorrent/gotorrent/clients/thepiratebay/thepiratebay.go:115 +0x207
github.com/ismaelpadilla/gotorrent/interfaces.Torrent.FetchFiles(...)
	/home/runner/work/gotorrent/gotorrent/interfaces/torrent.go:28
github.com/ismaelpadilla/gotorrent/ui.(*Model).showFiles(0xc0000dea00)
	/home/runner/work/gotorrent/gotorrent/ui/ui.go:426 +0xd5
github.com/ismaelpadilla/gotorrent/ui.(*Model).handleKeyPress(0xc0000dea00, {0xffffffffffffffff, {0xc000b34ab8, 0x1, 0x1}, 0x0})
	/home/runner/work/gotorrent/gotorrent/ui/ui.go:169 +0x6f2
github.com/ismaelpadilla/gotorrent/ui.Model.Update({{0x96b998, 0xc392e8}, {0xc001540000, 0x64, 0x64}, {0x0, 0x0}, 0x0, {0x0, 0x0}, ...}, ...)
	/home/runner/work/gotorrent/gotorrent/ui/ui.go:74 +0x2db
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel(0xc0000be370)
	/home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:540 +0x1291
github.com/charmbracelet/bubbletea.(*Program).Start(...)
	/home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:549
github.com/ismaelpadilla/gotorrent/cmd.glob..func1(0xbfe440?, {0xc392e8, 0x0, 0x0})
	/home/runner/work/gotorrent/gotorrent/cmd/root.go:45 +0x256
github.com/spf13/cobra.(*Command).execute(0xbfe440, {0xc00001e220, 0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:876 +0x67b
github.com/spf13/cobra.(*Command).ExecuteC(0xbfe440)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:918
github.com/ismaelpadilla/gotorrent/cmd.Execute()
	/home/runner/work/gotorrent/gotorrent/cmd/root.go:56 +0x2a
main.main()
	/home/runner/work/gotorrent/gotorrent/main.go:8 +0x17

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.