commit 0eadc5da5573f98cfd1482cad46717aa25a050b3 Author: Brahim Hadriche Date: Sun Oct 30 16:17:37 2022 -0400 initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..6313b56c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e7a88a65 --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +.DS_Store +build +###BrightScript specific +dist/apps +out/ + +#Rooibos generated +rooibosFunctionMap.brs + +### Eclipse project files + +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# Eclipse Core +.project +.classpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +node_modules/ +out +**/roku_modules/ +package-lock.json + +!.vscode +.vscode/.env +dist/ + +.history \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..8bbba6a8 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,32 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "brightscript", + "request": "launch", + "name": "Roku Youtube App", + "preLaunchTask": "roku-youtube", + "internalConsoleOptions": "neverOpen", + "envFile": "${workspaceFolder}/.vscode/.env", + "host": "${env:ROKU_DEV_TARGET}", + "password": "${env:ROKU_DEVPASSWORD}", + "outDir": "${workspaceFolder}/out", + "rootDir": "${workspaceFolder}/build", + "consoleOutput": "normal", + "stopOnEntry": false, + "retainDeploymentArchive": true, + "retainStagingFolder": true, + "autoRunSgDebugCommands": [], + "files": [ + "manifest", + "*.*", + "**/*.*", + "!*.zip", + "!**/*.zip" + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..c30e9480 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,25 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "roku-youtube", + "type": "shell", + "command": "npm run build", + "problemMatcher": [], + "presentation": { + "echo": true, + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": true + }, + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..9c3c789a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +### Added +- Initial version +- Reads feeds from popular and trending videos using Invidious APIs +- Skips sections using SponsorBlock \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000..1c2ffcbc --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Youbtube for Roku +Unofficial Youtube client for Roku. + +## Features +- No Ads (I guess that's a feature) +- Privacy driven (uses Invidious backend) +- SponsorBlock integration (skips undesirable sections in videos) + +## Installation +Install as a dev channel using this command +``` +TODO +``` diff --git a/bsconfig.json b/bsconfig.json new file mode 100644 index 00000000..32dd123d --- /dev/null +++ b/bsconfig.json @@ -0,0 +1,53 @@ +{ + "rootDir": "src", + "files": [ + "manifest", + "source/**/*.*", + "images/**/*.*", + "meta/**/*.*", + "components/**/*.*", + "!**/*.spec.bs" + ], + "autoImportComponentScript": true, + "createPackage": false, + "stagingFolderPath": "build", + "diagnosticFilters": [ + { + "src": "**/roku_modules/**/*.*" + }, + { + "src": "**/*spec.bs", + "codes": ["LINT3011"] + }, + { + "src": "**/RALETrackerTask.*" + }, + { + "src": "**/*.*" + } + ], + "emitDefinitions": true, + "plugins": [ + "maestro-roku-bsc-plugin", + "roku-log-bsc-plugin", + "@rokucommunity/bslint" + ], + "rooibos": { + "isRecordingCodeCoverage": false, + "testsFilePattern": null, + "tags": ["!integration", "!deprecated", "!fixme"], + "showOnlyFailures": true, + "catchCrashes": true, + "lineWidth": 70 + }, + "rokuLog": { + "strip": false, + "insertPkgPath": true + }, + "sourceMap": true, + "maestro": { + "excludeFilters": ["**/roku_modules/**/*", "**/rooibos/**/*"], + "buildForIDE": false, + "paramStripExceptions": ["onKeyEvent"] + } +} diff --git a/bslint.json b/bslint.json new file mode 100644 index 00000000..a4571896 --- /dev/null +++ b/bslint.json @@ -0,0 +1,18 @@ +{ + "rules": { + "inline-if-style": "no-then", + "block-if-style": "no-then", + "condition-style": "no-group", + "named-function-style": "no-sub", + "anon-function-style": "no-sub", + "type-annotations": "args", + "assign-all-paths": "off", + "unsafe-path-loop": "error", + "unsafe-iterators": "error", + "unreachable-code": "warn", + "case-sensitivity": "warn", + "unused-variable": "warn", + "consistent-return": "error", + "aa-comma-style": "never" + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..4fefe70a --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "name": "youtube-roku", + "version": "0.1.0", + "description": "Unofficial Youtube client for Roku", + "dependencies": { + "bslib": "npm:@rokucommunity/bslib@^0.1.1", + "log": "npm:roku-log@^0.8.0", + "maestro": "npm:maestro-roku@^0.47.0", + "roku-requests": "^0.2.0" + }, + "devDependencies": { + "@rokucommunity/bslint": "^0.7.5", + "brighterscript": "^0.60.4", + "maestro-roku-bsc-plugin": "^0.25.7", + "roku-log-bsc-plugin": "^0.6.1", + "rooibos-roku": "^5.2.3", + "ropm": "^0.10.10" + }, + "ropm": { + "rootDir": "src", + "packageRootDir": "dist", + "noprefix": [ + "maestro" + ] + }, + "scripts": { + "build": "node scripts/run-roku-youtube.js", + "test": "echo \"Error: no test specified\" && exit 1", + "postinstall": "npx ropm copy", + "lint": "npx bsc" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } +} diff --git a/scripts/run-roku-youtube.js b/scripts/run-roku-youtube.js new file mode 100644 index 00000000..63f0d3c1 --- /dev/null +++ b/scripts/run-roku-youtube.js @@ -0,0 +1,18 @@ +const path = require('path'); +const ProgramBuilder = require('brighterscript').ProgramBuilder; +const DiagnosticSeverity = require('brighterscript').DiagnosticSeverity; + +let programBuilder = new ProgramBuilder(); +programBuilder.run({ + project: path.join(__dirname, '../', 'bsconfig.json') +}).then(() => { + //fail if there are diagnostics + if (programBuilder.program.getDiagnostics().filter((x) => x.severity === DiagnosticSeverity.Error).length > 0) { + throw new Error('Encountered error diagnostics'); + } else { + console.log('\nBuild is finished'); + } +}).catch(e => { + console.log('error', e.message); + process.exit(1); +}); diff --git a/src/components/GridScreen/GridScreen.brs b/src/components/GridScreen/GridScreen.brs new file mode 100644 index 00000000..a1f52a27 --- /dev/null +++ b/src/components/GridScreen/GridScreen.brs @@ -0,0 +1,13 @@ +import "pkg:/source/utils/Utils.bs" + +sub Init() + m.rowList = m.top.FindNode("rowList") + m.rowList.SetFocus(true) + m.top.ObserveField("visible", "onVisibleChange") +end sub + +sub OnVisibleChange() ' invoked when GridScreen change visibility + if m.top.visible = true + m.rowList.SetFocus(true) ' set focus to rowList if GridScreen visible + end if +end sub \ No newline at end of file diff --git a/src/components/GridScreen/GridScreen.xml b/src/components/GridScreen/GridScreen.xml new file mode 100644 index 00000000..caf1143e --- /dev/null +++ b/src/components/GridScreen/GridScreen.xml @@ -0,0 +1,25 @@ + + + +