Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ public/js/build.min.js
test*.js
public/vids/*
npm-debug.log
config.json
config.json
mongod.pdb
mongos.pdb
config.json
54 changes: 54 additions & 0 deletions InstallCompass.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#Requires -Version 3.0
<#
.SYNOPSIS
Download and install latest version of MongoDB Compass.

.DESCRIPTION
A longer description.

.INPUTS
Description of objects that can be piped to the script

.OUTPUTS
Description of objects that are output by the script

.EXAMPLE
Example of how to run the script

.LINK
Links to further documentation

.NOTES
Detail on what the script does, if this is needed
#>
param()
$ErrorActionPreference = 'Stop'

$CompassUrl = 'https://compass.mongodb.com/api/v2/download/latest/compass/stable/windows'

$TemporaryDir = [System.IO.Path]::GetTempPath()
$CompassExe = "$TemporaryDir" + "compass-install.exe"

Remove-Item $CompassExe -ErrorAction:Ignore

try {
Write-Output "Downloading Compass from $CompassUrl"

# Default PowerShell SecurityProtocol does not support Tls1.2 (required by domain)
if ([Net.ServicePointManager]::SecurityProtocol.ToString() -NotMatch "Tls12") {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
}
Invoke-WebRequest -Uri $CompassUrl -OutFile $CompassExe

Write-Output "Installing Compass"
& $CompassExe
Write-Output "Successfully installed Compass"
} catch {
# Fail silently. With the way that we've hooked into the MSI
# currently we're not able to do any meaningful error reporting
# and not crash the installer.
Write-Output "Error installing Compass."
}

# Remove the binary we downloaded
Remove-Item $CompassExe -ErrorAction:Ignore
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Why this fork?
the old project hasn't been changed in 5 years

### Changelog
1. added electron interface
2. added easier config



# myTube: Youtube without the bloat

![](http://i.imgur.com/Be2omEM.jpg)
Expand Down Expand Up @@ -32,9 +41,23 @@ myTube on the other hand doesn't require you to have the video element focused.
* Shake on mobile to go back 5 seconds

### How to Setup
1. Clone this repo and run `npm install`.
2. Add the database user by running `mongo < mongoSetup`. This will create the default collection `myTube` and the default user `myTube`. If you want to use any other db/user make sure you update the `config.json` file.
3. Get a Youtube Data API from Google and add the API key to the `config.json` file.
4. Run `gulp` to build the views.
5. Double check that your config settings are all set the way you like and run `npm start` to start the myTube server.
6. Access myTube at `http://localhost:3000`
```
git clone https://github.com/keitharm/mytube
cd mytube
```
then read docs.txt

**windows:**
```
install-dep.sh
start.sh
```

**other:**
```
bash install-dep.sh
bash start.sh
```

# Help?
please check docs.txt
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"socket": 8080,
"updateInterval": 300,
"simultaneousDownloads": 1,
"apikey": "",
"apikey": "AIzaSyAIFRG3KdSkLSo5_PAorogQphb0j-iDI14",
"quality": "299+140/298+140/137+140/136+140/bestvideo[ext!=webm]+bestaudio[ext!=webm]/best[ext!=webm]",
"downloadDelay": 1800,
"db": {
Expand Down
19 changes: 19 additions & 0 deletions docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```
npm install
npm i --save-dev electron
```

# If you don't have mongo DB you can get it from here, https://mongodb.com

mongo < mongoSetup

# config.json
# go to config.json
# check https://www.youtube.com/watch?v=VqML5F8hcRQ for help
```
gulp
npm start
```

# done, the bash script is located at install-dep.sh
# then run start.exe (win) or start.sh
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Mytube</title>
<meta http-equiv = "refresh" content = "10; url = http://localhost:3000" />
</head>
<body>
<p>This page will redirect in 10 seconds.</p>
<p>While I make the app, <a href = "https://discord.gg/d3UpBmfchG">Aspiring coder is making the bot for discord :)</a>
</body>
</html>
16 changes: 16 additions & 0 deletions install-dep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
npm install
npm i --save-dev electron

echo "If you don't have mongo DB you can get it from here, https://mongodb.com"

mongo < mongoSetup

echo "config.json"
echo "go to config.json"
echo "check https://www.youtube.com/watch?v=VqML5F8hcRQ for help"

gulp
npm start


echo "run start.exe (win) or start.sh ()linux/mac"
23 changes: 23 additions & 0 deletions login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<body>

<p>Click the button to demonstrate the prompt box.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
var person = prompt("Please enter your name", "Harry Potter");
if (person != null) {
document.getElementById("demo").innerHTML =
"Hello " + person + "! How are you today?";
}
}
</script>

</body>
</html>

29 changes: 29 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { app, BrowserWindow } = require('electron')

function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
console.log("remember to check the config files")
console.log("or check docs.txt for the steps")
win.loadFile('index.html')
}

app.whenReady().then(createWindow)

app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})

app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

Binary file added mongo.exe
Binary file not shown.
41 changes: 41 additions & 0 deletions mongod.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# mongod.conf

# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
dbPath: C:\Program Files\MongoDB\Server\4.4\data
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:

# where to write logging data.
systemLog:
destination: file
logAppend: true
path: C:\Program Files\MongoDB\Server\4.4\log\mongod.log

# network interfaces
net:
port: 27017
bindIp: 127.0.0.1


#processManagement:

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:
Binary file added mongod.exe
Binary file not shown.
Binary file added mongos.exe
Binary file not shown.
Binary file added mtube.build/.sconsign-39.dblite
Binary file not shown.
11 changes: 11 additions & 0 deletions mtube.build/@link_input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"./__constants.o"
"./__helpers.o"
"./__loader.o"
"./module.__main__.o"
"./static_src/MainProgram.o"
"./static_src/CompiledCellType.o"
"./static_src/CompiledFunctionType.o"
"./static_src/CompiledGeneratorType.o"
"./static_src/CompiledCodeHelpers.o"
"./static_src/InspectPatcher.o"
"./static_src/MetaPathBasedLoader.o"
Empty file added mtube.build/__bytecode.const
Empty file.
Binary file added mtube.build/__constants.bin
Binary file not shown.
126 changes: 126 additions & 0 deletions mtube.build/__constants.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@

#include "nuitka/prelude.h"
#include "structseq.h"

// Global constants storage
PyObject *global_constants[69];

// Sentinel PyObject to be used for all our call iterator endings. It will
// become a PyCObject pointing to NULL. It's address is unique, and that's
// enough for us to use it as sentinel value.
PyObject *_sentinel_value = NULL;

PyObject *Nuitka_dunder_compiled_value = NULL;


#ifdef _NUITKA_STANDALONE
extern PyObject *getStandaloneSysExecutablePath(PyObject *basename);
#endif

static void _createGlobalConstants(void) {
// The empty name means global.
loadConstantsBlob(&global_constants[0], "", 69);

#if _NUITKA_EXE
/* Set the "sys.executable" path to the original CPython executable or point to inside the
distribution for standalone. */
PySys_SetObject(
(char *)"executable",
#ifndef _NUITKA_STANDALONE
global_constants[67]
#else
getStandaloneSysExecutablePath(global_constants[67])
#endif
);

#ifndef _NUITKA_STANDALONE
/* Set the "sys.prefix" path to the original one. */
PySys_SetObject(
(char *)"prefix",
global_constants[68]
);

/* Set the "sys.prefix" path to the original one. */
PySys_SetObject(
(char *)"exec_prefix",
global_constants[68]
);


#if PYTHON_VERSION >= 0x300
/* Set the "sys.base_prefix" path to the original one. */
PySys_SetObject(
(char *)"base_prefix",
global_constants[68]
);

/* Set the "sys.exec_base_prefix" path to the original one. */
PySys_SetObject(
(char *)"base_exec_prefix",
global_constants[68]
);

#endif
#endif
#endif

static PyTypeObject Nuitka_VersionInfoType;

// Same fields as "sys.version_info" except no serial number.
static PyStructSequence_Field Nuitka_VersionInfoFields[] = {
{(char *)"major", (char *)"Major release number"},
{(char *)"minor", (char *)"Minor release number"},
{(char *)"micro", (char *)"Micro release number"},
{(char *)"releaselevel", (char *)"'alpha', 'beta', 'candidate', or 'release'"},
{0}
};

static PyStructSequence_Desc Nuitka_VersionInfoDesc = {
(char *)"__nuitka_version__", /* name */
(char *)"__compiled__\\n\\nVersion information as a named tuple.", /* doc */
Nuitka_VersionInfoFields, /* fields */
4
};

PyStructSequence_InitType(&Nuitka_VersionInfoType, &Nuitka_VersionInfoDesc);

Nuitka_dunder_compiled_value = PyStructSequence_New(&Nuitka_VersionInfoType);
assert(Nuitka_dunder_compiled_value != NULL);

PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 0, PyInt_FromLong(0));
PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 1, PyInt_FromLong(6));
PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 2, PyInt_FromLong(12));

PyStructSequence_SET_ITEM(Nuitka_dunder_compiled_value, 3, Nuitka_String_FromString("release"));

// Prevent users from creating the Nuitka version type object.
Nuitka_VersionInfoType.tp_init = NULL;
Nuitka_VersionInfoType.tp_new = NULL;


}

// In debug mode we can check that the constants were not tampered with in any
// given moment. We typically do it at program exit, but we can add extra calls
// for sanity.
#ifndef __NUITKA_NO_ASSERT__
void checkGlobalConstants(void) {
// TODO: Ask constant code to check values.

}
#endif

void createGlobalConstants(void) {
if (_sentinel_value == NULL) {
#if PYTHON_VERSION < 0x300
_sentinel_value = PyCObject_FromVoidPtr(NULL, NULL);
#else
// The NULL value is not allowed for a capsule, so use something else.
_sentinel_value = PyCapsule_New((void *)27, "sentinel", NULL);
#endif
assert(_sentinel_value);

_createGlobalConstants();
}
}

Binary file added mtube.build/__constants.const
Binary file not shown.
Loading