Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Support? Problems and temporary solutions. #5

Open
bachig26 opened this issue Nov 13, 2022 · 15 comments
Open

Windows Support? Problems and temporary solutions. #5

bachig26 opened this issue Nov 13, 2022 · 15 comments
Labels
bug Something isn't working working Working on it.

Comments

@bachig26
Copy link

No description provided.

@FlamesX-128
Copy link
Collaborator

FlamesX-128 commented Nov 13, 2022

Currently Go plugins are only supported on Linux, FreeBSD, and macOS. 😢

https://pkg.go.dev/plugin

@FlamesX-128 FlamesX-128 added the enhancement New feature or request label Nov 13, 2022
@FlamesX-128
Copy link
Collaborator

@bachig26 I made a small version with integrated consumet, I tried it slightly with wine

anigo@[email protected]

@bachig26
Copy link
Author

@FlamesX-128 it worked for me, but there are some issues like:

  1. when I tried it without manually downloading plugins, it installs both plugin but only showing gogoanime. also after it said that the plugins are installed...there is no files in the folder.

  2. when downloaded the plugins manually, it still says that it needs to download as there is no plugins.

λ anigo
? No plugins found, do you want to install some? Yes
[Plugin] [Installing] [email protected]
[Plugin] [Installing] [email protected]
? Select an option Search
? Select a provider  [Use arrows to move, type to filter]
> [API] [Direct] GoGoAnime

as you can see only GoGoAnime is showing as a provider, even after the Installing plugins shows both.

  1. when I exit the program, it displays an error:
? Select an option Exit
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xaa5739]

goroutine 1 [running]:
main.main()
        /home/flames/go/github.com/FlamesX-128/anigo/main.go:50 +0x119

@bachig26
Copy link
Author

@FlamesX-128

I changed the directory: C:\anigo\anigo\plugins, also reverted the anigo filename to original name as anigo@integrated-win@amd64.

image

λ anigo@integrated-win@amd64
? Select an option Search
? Select a provider  [Use arrows to move, type to filter]
> [API] [Direct] GoGoAnime

still I can't see all the available plugins and has the same exit error.

I want to ask if the Exit or Back option provided at the each line if possible.

@FlamesX-128
Copy link
Collaborator

@bachig26
1- I will check the plugin system later, in theory it should not show any that are not from your system:

2- It lets you watch the anime but when you leave it gives an error or it give an error before you can watch the anime?

@FlamesX-128
Copy link
Collaborator

FlamesX-128 commented Nov 13, 2022

@bachig26
Go's plugin system doesn't work on windows, so just integrate consumet directly into the program, it won't download anything.

import (
    // <...>
    "github.com/FlamesX-128/anigo-plugins/consumet/gogoanime"
)

func init() {
    // <...>
    providers["[Api] [Direct] GoGoAnime "] = gogoanime.PackageModel{}
}

@bachig26
Copy link
Author

2- It lets you watch the anime but when you leave it gives an error or it give an error before you can watch the anime?

it lets me watch anime, but it didn't give me the error when I leave it or before it...the error only shows when select the Exit option.

Example:

λ anigo@integrated-win@amd64
? Select an option Search
? Select a provider [API] [Direct] GoGoAnime
? what novel do you want to look for? naruto

? what novel do you want to look for? naruto
? which novel do you want to select? Naruto Shippuden
? which do you want to select? watch
? which episode do you want to select? (1-500) 1

? which episode do you want to select? (1-500) 1
? which quality do you want to select? 360p
? Select an option Exit
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xcf5739]

goroutine 1 [running]:
main.main()
        /home/flames/go/github.com/FlamesX-128/anigo/main.go:50 +0x119

@FlamesX-128
Copy link
Collaborator

FlamesX-128 commented Nov 13, 2022

@bachig26
I think it's how os.Exit() works, which is used to kill the program.

image

@bachig26
Copy link
Author

@bachig26 Go's plugin system doesn't work on windows, so just integrate consumet directly into the program, it won't download anything.

import (
    // <...>
    "github.com/FlamesX-128/anigo-plugins/consumet/gogoanime"
)

func init() {
    // <...>
    providers["[Api] [Direct] GoGoAnime "] = gogoanime.PackageModel{}
}

sorry, but I can't clearly understand this... as far I can get that the consumet iintegrated already.

if that's the case, then it should not ask for installing the plugins while running the anigo, right?

@FlamesX-128
Copy link
Collaborator

FlamesX-128 commented Nov 13, 2022

@bachig26

By default it is not installed, when the program asks you if you want to install it should download a ".so" or ".dylib" file.

These are saved in anigo/plugins where they will be loaded every time it is turned on.

In the case of windows, it uses ".dll", it is not supported by the Go library, the temporary solution I did was directly add it to the program.

Original code:

func init() {
	var root string
	var err error

	if root, err = os.Getwd(); err != nil {
		log.Panicln(color.RedString("[Plugin] [Init] [Error] %s", err.Error()))

		return
	}

	// Load plugins.
	for _, plugin := range plugins.Init[models.Plugin](root, "Plugin") {
		// Register provider.
		for name, provider := range plugin.Providers {
			providers[name] = provider
		}

	}

}

Temporary solution for windows.

func init() {
	var root string
	var err error

	if root, err = os.Getwd(); err != nil {
		log.Panicln(color.RedString("[Plugin] [Init] [Error] %s", err.Error()))

		return
	}

	// Load plugins.
	// Won't install plugins.
	for _, plugin := range plugins.Init[models.Plugin](root, "Plugin") {
		// Register provider.
		for name, provider := range plugin.Providers {
			providers[name] = provider
		}

	}

       // compile "anigo-plugins/consumet/gogoanime" with the core.
       providers["[Api] [Direct] GoGoAnime "] = gogoanime.PackageModel{}
}

@FlamesX-128 FlamesX-128 changed the title [Request] Windows support? Windows Support? Problems and temporary solutions. Nov 13, 2022
@FlamesX-128 FlamesX-128 added bug Something isn't working help wanted Extra attention is needed labels Nov 13, 2022
@FlamesX-128
Copy link
Collaborator

I was going to integrate monoschinos too but because I put the code in a "main" package instead of a "monochinos" package I couldn't add it. 😢

@FlamesX-128 FlamesX-128 added bug Something isn't working working Working on it. and removed bug Something isn't working help wanted Extra attention is needed enhancement New feature or request labels Nov 14, 2022
@FlamesX-128
Copy link
Collaborator

FlamesX-128 commented Dec 14, 2022

anigo@[email protected]
[Español|Spanish] monochinos2 added.

@bachig26
Copy link
Author

anigo@[email protected] monochinos2 added.

thank you, i'll try it out 👍

@FlamesX-128
Copy link
Collaborator

FlamesX-128 commented Dec 14, 2022

[Rewrite to Rust] I'm working on compatibility and improving the plugin manager, it may take me a few days to finish it. So sorry for taking so long.

@bachig26
Copy link
Author

[Rewrite to Rust] I'm working on compatibility and improving the plugin manager, it may take me a few days to finish it. So sorry for taking so long.

no worries. 🍀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working working Working on it.
Projects
None yet
Development

No branches or pull requests

2 participants