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
Add mega.nz support #2286
Comments
specific instructions on how to implement the enhancement might help me nd other "normal" miners, thank you very much. I read the docs, but still didn't succeed to get it run :( |
@skovesh I think you've misunderstood the issues section on Github. The releases are published here: https://github.com/MultiPoolMiner/MultiPoolMiner/releases |
I wrote out a powershell translation. Thought I would share as this issue was inspiration. Use this nuget package (.dll): https://www.nuget.org/packages/MegaApiClient/ extract .dll with 7z Add-Type -Path "MegaApiClient.dll"
function Get-MegaDownload($link) {
$id = [IO.Path]::GetFileName($link);
$client = [CG.Web.MegaApiClient.MegaApiClient]::New();
$client.LoginAnonymous();
[uri]$uri = [uri]::New($link);
[System.Collections.Generic.IEnumerable[CG.Web.MegaApiClient.INode]]$nodes = $client.GetNodesFromLink($uri);
$node = $nodes | Where-Object id -eq $id;
## Determine full path to download file
$Path = [IO.Path]::Combine([IO.Path]::Combine($global:Dir, "x64"), $node.Name);
if ([IO.File]::Exists($Path)) {
Remove-Item -Path $Path -Force
}
Using-Object ($stream = $client.Download($node)) {
Using-Object ($filestream = [System.IO.FileStream]::New($Path, [System.IO.FileMode]::CreateNew)) {
$stream.CopyTo($filestream);
}
}
$client.Logout();
## Return path for reference and folder name, since we didn't know it based on link.
return $Path;
} Requires the ability to run C# using statement. Below is an example: function Using-Object
{
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[AllowEmptyString()]
[AllowEmptyCollection()]
[AllowNull()]
[Object]
$InputObject,
[Parameter(Mandatory = $true)]
[scriptblock]
$ScriptBlock
)
try
{
. $ScriptBlock
}
finally
{
if ($null -ne $InputObject -and $InputObject -is [System.IDisposable])
{
$InputObject.Dispose()
}
}
} |
MultiPoolMiner/Include.psm1
Line 1192 in ad2784e
Written in C#; looks hopefull:
https://github.com/gpailler/MegaApiClient
The text was updated successfully, but these errors were encountered: