Merge branch 'development'

This commit is contained in:
PrestonN 2018-06-16 16:37:57 -04:00
commit c402fa6827
15 changed files with 247 additions and 27 deletions

View File

@ -10,7 +10,15 @@ Please note that FreeTube is currently in Beta. While it should work well for
most users, there are still bugs and missing features that need to be
addressed.
[Download](https://github.com/FreeTubeApp/FreeTube/releases)
[Download FreeTube](https://github.com/FreeTubeApp/FreeTube/releases)
### Browser Extension
Download our browser extension so that you can click on videos in your browser and have them automatically open up in FreeTube.
[Download for Firefox](https://addons.mozilla.org/en-US/firefox/addon/freetube-redirect/)
[Instructrions for Google Chrome](https://github.com/FreeTubeApp/FreeTube/wiki/Browser-Extension)
## How does it work?
FreeTube uses the proprietary [YouTube HTTP
@ -33,6 +41,7 @@ to hide your IP while using FreeTube.
* Subscribe to channels without an account
* Local subscriptions, history, and saved videos
* Export & import subscriptions
* Open videos from your browser directly into FreeTube (with extension)
* Mini Player
* Light / dark theme

95
locales/it.IT.json Normal file
View File

@ -0,0 +1,95 @@
{
"File": "File",
"Quit": "Esci",
"Edit": "Modifica",
"Undo": "Annulla",
"Redo": "Ripeti",
"Cut": "Taglia",
"Copy": "Copia",
"Paste": "Incolla",
"Delete": "Elimina",
"Select all": "Seleziona Tutto",
"View": "Visualizza",
"Reload": "Ricarica",
"Force Reload": "Forza Ricarica",
"Toggle Developer Tools": "Apri Strumenti Sviluppatore",
"Actual size": "Dimensione Attuale",
"Zoom in": "Ingrandisci",
"Zoom out": "Diminuisci",
"Toggle fullscreen": "Entra in modalità schermo intero",
"Window": "Finestra",
"Minimize": "Minimizza",
"Close": "Chiudi",
"FreeTube": "FreeTube",
"Subscriptions": "Sottoscrizioni",
"Featured": "Featured",
"Most Popular": "Più popolari",
"Saved": "Salvati",
"Playlists": "Playlist",
"History": "Cronologia",
"Settings": "Impostazioni",
"About": "Info",
"Search / Go to URL": "Cerca / Vai all' URL",
"Search Results": "Cerca Risultati",
"Subscriber": "Iscritto",
"Subscriber": "Iscritti",
"Video": "Video",
"Videos": "Video",
"View Full Playlist": "Vedi Intera Playlist",
"Live Now": "Live Ora",
"Fetch more results": "Ottieni più risultati",
"Fetching results. Please wait": "Ottenendo più risultati. Attendi per favore",
"Latest Subscriptions": "Ultime sottoscrizioni",
"Save Video": "Salva Video",
"Remove Saved Video": "Rimuovi Video Salvati",
"Open in YouTube": "Apri su YouTube",
"Copy YouTube Link": "Copia Link Youtube",
"Open in HookTube": "Apri in HookTube",
"Copy HookTube Link": "Copy Link HookTube",
"URL has been copied to the clipboard": "L'URL è stato copiato negli appunti",
"Found valid URL for 480p, but returned a 404. Video type might be available in the future.": "Trovato URL valido per 480p, ma è stato restituito un errore 404. Il tipo di video potrebbe essere disponibile in futuro.",
"Save": "Salva",
"Mini Player": "Mini Player",
"View": "Visualizzazione",
"Views": "Visualizzazioni",
"Subscribe": "Iscriviti",
"Unsubscribe": "Disiscriviti",
"Published on": "Pubblicato il",
"Jan": "Gen",
"Feb": "Feb",
"Mar": "Mar",
"Apr": "Apr",
"May": "Mag",
"Jun": "Giu",
"Jul": "Lug",
"Aug": "Ago",
"Sep": "Set",
"Oct": "Ott",
"Nov": "Nov",
"Dec": "Dic",
"Show Comments": "Mostra Commenti",
"Max of 100": "Massimo di 100",
"Recommendations": "Raccomandati",
"Latest Subscriptions": "Ultime Sottoscrizioni",
"Getting Subscriptions. Please wait...": "Ottenendo Sottoscrizioni. Per favore attendi...",
"Your Subscription list is currently empty. Start adding subscriptions to see them here.": "La tua lista iscritti è vuota al momento. Inizia ad aggiungere sottoscrizioni per vederle qui.",
"Saved Videos": "Video Salvati",
"Watch History": "Guarda Cronologia",
"API Key": "Chiave API",
"Set API Key: Leave blank to use default": "Setta Chiave API: Lascia bianco per usare quella di default",
"Use Dark Theme": "Usa Tema Scuro",
"Import Subscriptions": "Importa Iscrizioni",
"Export Subscriptions": "Esporta Iscrizioni",
"Clear History": "Cancella Cronologia",
"Are you sure you want to delete your history?": "Sei sicuro di voler cancellare la cronologia?",
"Clear Saved Videos": "Cancella Video Salvati",
"Are you sure you want to remove all saved videos?": "Sei sicuro di voler rimuovere tutti i video salvati?",
"Clear Subscriptions": "Cancella Sottoscrizioni",
"Are you sure you want to remove all subscriptions?": "Sei sicuro di voler rimuovere tutte le sottoscrizioni?",
"Save Settings": "Salva Impostazioni",
"Yes": "Sì",
"No": "No",
"Beta": "Beta",
"This software is FOSS and released under the GNU Public License v3+.": "Questo software è FOSS e rilasciato sotto licenza GNU Public License v3+.",
"Found a bug? Want to suggest a feature? Want to help out? Check out our GitHub page. Pull requests are welcome.": "Trovato un bug? Vuoi suggerire una funzionalità? Vuoi aiutare? Controlla la nostra pagina di GitHub. Le Pull request sono le benvenute."
}

95
locales/ru.json Normal file
View File

@ -0,0 +1,95 @@
{
"File": "Файл",
"Quit": "Выйти",
"Edit": "Редактировать",
"Undo": "Отмена",
"Redo": "Восстановить",
"Cut": "Вырезать",
"Copy": "Копировать",
"Paste": "Вставить",
"Delete": "Удалить",
"Select all": "Выбрать все",
"View": "Просмотр",
"Reload": "Обновить",
"Force Reload": "Перезагрузка",
"Toggle Developer Tools": "Переключение инструментов разработчика",
"Actual size": "Фактический размер",
"Zoom in": "Увеличить",
"Zoom out": "Уменьшить",
"Toggle fullscreen": "Полноэкранный режим",
"Window": "Окно",
"Minimize": "Свернуть",
"Close": "Закрыть",
"FreeTube": "FreeTube",
"Subscriptions": "Подписки",
"Featured": "Популярные",
"Most Popular": "В тренде",
"Saved": "Сохраненные",
"Playlists": "Списки воспроизведения",
"History": "История",
"Settings": "Настройки",
"About": "О программе",
"Search / Go to URL": "Поиск / перейти по URL",
"Search Results": "Результаты поиска",
"Subscriber": "Подписка",
"Subscriber": "Подписчиков",
"Video": "Видео",
"Videos": "Видео",
"View Full Playlist": "Список воспроизведения",
"Live Now": "Live Now",
"Fetch more results": "Больше результатов",
"Fetching results. Please wait": "Получение ответа. Ждите",
"Latest Subscriptions": "Недавние подписки",
"Save Video": "Сохранить видео",
"Remove Saved Video": "Удалить сохраненное видео",
"Open in YouTube": "Открыть на YouTube",
"Copy YouTube Link": "Копировать ссылку YouTube",
"Open in HookTube": "Открыть на HookTube",
"Copy HookTube Link": "Копировать ссылку HookTube",
"URL has been copied to the clipboard": "URL скопирован в буфер обмена",
"Found valid URL for 480p, but returned a 404. Video type might be available in the future.": "Найден допустимый URL для 480p, но возвращен 404. Тип видео может быть доступен в будущем.",
"Save": "Save",
"Mini Player": "Мини-плеер",
"View": "Поросмотр",
"Views": "Просмотры",
"Subscribe": "Подписаться",
"Unsubscribe": "Отписаться",
"Published on": "Опубликовано",
"Jan": "Янв",
"Feb": "Фев",
"Mar": "Мар",
"Apr": "Апр",
"May": "Май",
"Jun": "Июн",
"Jul": "Июл",
"Aug": "Авг",
"Sep": "Сен",
"Oct": "Окт",
"Nov": "Ноя",
"Dec": "Дек",
"Show Comments": "Показать комментарии",
"Max of 100": "Max of 100",
"Recommendations": "Рекомендованные",
"Latest Subscriptions": "Недавние подписки",
"Getting Subscriptions. Please wait...": "Загрузка подписок. Подождите...",
"Your Subscription list is currently empty. Start adding subscriptions to see them here.": "Ваш список подписки в настоящее время пуст. Начните добавлять подписки, чтобы увидеть их здесь.",
"Saved Videos": "Сохранить видео",
"Watch History": "Просмотр истории",
"API Key": "API Key",
"Set API Key: Leave blank to use default": "Установить ключ API: оставьте пустым, чтобы использовать по умолчанию",
"Use Dark Theme": "Использовать темную тему",
"Import Subscriptions": "Импорт подписок",
"Export Subscriptions": "Экспорт подписок",
"Clear History": "Очистить историю",
"Are you sure you want to delete your history?": "Вы уверены, что хотите удалить всю историю?",
"Clear Saved Videos": "Очистить сохраненные видео",
"Are you sure you want to remove all saved videos?": "Вы уверены, что хотите удалить все сохраненные видео?",
"Clear Subscriptions": "Очистить подписки",
"Are you sure you want to remove all subscriptions?": "Вы уверены, что хотите удалить все подписки?",
"Save Settings": "Сохранить настройки",
"Yes": "Да",
"No": "Нет",
"Beta": "Beta",
"This software is FOSS and released under the GNU Public License v3+.": "Это программное обеспечение является FOSS и Выпущено под GNU Public License v3+.",
"Found a bug? Want to suggest a feature? Want to help out? Check out our GitHub page. Pull requests are welcome.": "Нашли ошибку? Хотите предложить функцию? Хотите помочь? Проверьте нашу страницу GitHub. Вопросы приветствуются."
}

View File

@ -1,7 +1,7 @@
{
"name": "FreeTube",
"productName": "FreeTube",
"version": "0.3.0",
"version": "0.3.1",
"description": "An Open Source YouTube app for privacy.",
"main": "src/js/init.js",
"scripts": {

View File

@ -64,7 +64,6 @@
<ul>
<li onclick='showSettings()'><i class="fas fa-sliders-h"></i>&nbsp;&nbsp;Settings</li>
<li onclick='showAbout()'><i class="fas fa-info-circle"></i>&nbsp;&nbsp;About</li>
<a href="https://github.com/FreeTubeApp/FreeTube/wiki" style='text-decoration: none; color: inherit;'><li><i class="fas fa-question-circle"></i>&nbsp;&nbsp;Help</li></a>
</ul>
<hr />
<ul id='subscriptions'>

View File

@ -83,9 +83,10 @@ const settingsDb = new Datastore({
checkDefaultSettings();
require('electron').ipcRenderer.on('ping', function(event, message) {
console.log(message);
let url = message[1].replace('freetube://', '');
parseSearchText(url);
console.log(message); // Prints "whoooooooh!"
console.log(message);
});
// Open links externally by default

View File

@ -119,11 +119,11 @@ function playVideo(videoId, videoThumbnail = '', useWindowPlayer = false) {
Object.keys(videoUrls).forEach((key) => {
switch (videoUrls[key]['itag']) {
case '18':
video480p = videoUrls[key]['url'];
video480p = decodeURIComponent(videoUrls[key]['url']);
console.log(video480p);
break;
case '22':
video720p = videoUrls[key]['url'];
video720p = decodeURIComponent(videoUrls[key]['url']);
console.log(video720p);
break;
}
@ -148,7 +148,7 @@ function playVideo(videoId, videoThumbnail = '', useWindowPlayer = false) {
}
if (!useEmbedPlayer) {
videoHtml = '<video class="videoPlayer" type="application/x-mpegURL" onmousemove="hideMouseTimeout()" onmouseleave="removeMouseTimeout()" controls="" src="' + defaultUrl + '" poster="' + videoThumbnail + '" autoplay>';
//videoHtml = '<video class="videoPlayer" type="application/x-mpegURL" onmousemove="hideMouseTimeout()" onmouseleave="removeMouseTimeout()" controls="" src="' + defaultUrl + '" poster="' + videoThumbnail + '" autoplay>';
if (typeof(info.player_response.captions) === 'object') {
@ -168,7 +168,7 @@ function playVideo(videoId, videoThumbnail = '', useWindowPlayer = false) {
}
}
videoHtml = videoHtml + '</video>';
//videoHtml = videoHtml + '</video>';
}
const checkSubscription = isSubscribed(channelId);
@ -192,8 +192,9 @@ function playVideo(videoId, videoThumbnail = '', useWindowPlayer = false) {
const playerTemplate = require('./templates/player.html')
mustache.parse(playerTemplate);
const rendered = mustache.render(playerTemplate, {
videoHtml: videoHtml,
videoQuality: defaultQuality,
subtitleHtml: videoHtml,
defaultUrl: defaultUrl,
videoTitle: info['title'],
videoViews: videoViews,
videoThumbnail: videoThumbnail,
@ -234,7 +235,7 @@ function playVideo(videoId, videoThumbnail = '', useWindowPlayer = false) {
videoId: videoId,
channelId: channelId
});
newWindow.loadURL('data:text/html;charset=UTF-8,' + encodeURIComponent(playerHeaderRender + rendered), {
baseURLForDataURL: `file://${__dirname}/src`
});
@ -245,11 +246,6 @@ function playVideo(videoId, videoThumbnail = '', useWindowPlayer = false) {
showVideoRecommendations(videoId);
// Sometimes a video URL is found, but the video will not play. I believe the issue is
// that the video has yet to render for that quality, as the video will be available at a later time.
// This will check the URLs and switch video sources if there is an error.
checkVideoUrls(video480p, video720p);
// Hide subtitles by default
if (typeof(info['subtitles']) !== 'undefined' && Object.keys(info['subtitles']).length > 0) {
let textTracks = $('.videoPlayer').get(0).textTracks;
@ -259,7 +255,12 @@ function playVideo(videoId, videoThumbnail = '', useWindowPlayer = false) {
}
}
// Sometimes a video URL is found, but the video will not play. I believe the issue is
// that the video has yet to render for that quality, as the video will be available at a later time.
// This will check the URLs and switch video sources if there is an error.
//checkVideoUrls(video480p, video720p);
window.setTimeout(checkVideoUrls, 5000, video480p, video720p);
});
}
@ -290,7 +291,7 @@ function openMiniPlayer(videoThumbnail) {
let miniPlayer = new BrowserWindow({
width: 1200,
height: 700
height: 710
});
// Use the miniPlayer.html template.

View File

@ -346,8 +346,25 @@ function importSubscriptions(){
function exportSubscriptions() {
const appDatabaseFile = localDataStorage + '/subscriptions.db';
const date = new Date();
let dateMonth = date.getMonth() + 1;
if (dateMonth < 10){
dateMonth = '0' + dateMonth;
}
let dateDay = date.getDate();
if (dateDay < 10){
dateDay = '0' + dateDay;
}
const dateYear = date.getFullYear();
const dateString = 'freetube-subscriptions-' + dateYear + '-' + dateMonth + '-' + dateDay;
// Open user file browser. User gives location of file to be created.
dialog.showSaveDialog({
defaultPath: dateString,
filters: [{
name: 'Database File',
extensions: ['db']

View File

@ -559,9 +559,6 @@ function checkVideoUrls(video480p, video720p) {
break;
default:
console.log('720p is valid');
if (currentQuality === '720p') {
return;
}
break;
}
});

View File

@ -1,5 +1,6 @@
.channelViewBanner{
width: 100%;
max-height: 200px;
margin-bottom: 30px;
}

View File

@ -5,7 +5,7 @@
}
::-webkit-scrollbar-thumb {
background: #212121;
background: #424242;
-webkit-border-radius: 1ex;
-webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.75);
}

View File

@ -1,8 +1,11 @@
<div class='center'>
<img src='icons/logoColor.png' width='500px;'/>
<h1>{{versionNumber}} Beta</h1>
<h2>This software is FOSS and released under the <a href='https://www.gnu.org/licenses/quick-guide-gplv3.html'>GNU Public License v3+</a>.</h2>
Found a bug? Want to suggest a feature? Want to help out? Check out our <a href='https://github.com/FreeTubeApp/FreeTube'>GitHub</a> page. Pull requests are welcome.
<p>Thank you very much to the <a href='https://github.com/FreeTubeApp/FreeTube/wiki/Credits'>People and Projects</a> that make FreeTube possible!</p>
<h3><i class='fas fa-envelope'></i>&nbsp;&nbsp;FreeTubeApp@protonmail.com</h3>
<h2>This software is FOSS and released under the <a href='https://www.gnu.org/licenses/quick-guide-gplv3.html'>GNU Public License v3+</a>.</h2>
<p>Found a bug? Want to suggest a feature? Want to help out? Check out our <a href='https://github.com/FreeTubeApp/FreeTube'>GitHub</a> page. Pull requests are welcome.</p>
<p>Thank you very much to the <a href='https://github.com/FreeTubeApp/FreeTube/wiki/Credits'>People and Projects</a> that make FreeTube possible!</p>
<p>Want to chat? Join our <a href='https://riot.im/app/#/room/#freetube:matrix.org'>Riot / Matrix Server</a>. Please check the <a href='https://github.com/FreeTubeApp/FreeTube/wiki/Matrix-Server-Info-&-Rules'>rules</a> before joining.</p>
<p>Looking for help? Check out our <a href='https://github.com/FreeTubeApp/FreeTube/wiki'>Wiki</a> page.</p>
<p>Check out our <a href='https://addons.mozilla.org/en-US/firefox/addon/freetube-redirect/'>Firefox</a> extension!</p>
</div>

View File

@ -1,4 +1,6 @@
{{{videoHtml}}}
<video class="videoPlayer" type="application/x-mpegURL" onmousemove="hideMouseTimeout()" onmouseleave="removeMouseTimeout()" controls="" src="{{defaultUrl}}" poster="{{videoThumbnail}}" autoplay>
{{{subtitleHtml}}}
</video>
<div class='statistics'>
<div class='smallButton' onclick="openMiniPlayer('{{videoThumbnail}}')">
MINI PLAYER <i class="fas fa-external-link-alt"></i>

View File

@ -7,7 +7,7 @@
<input type="checkbox" id="themeSwitch" name="set-name" class="switch-input" onchange='toggleTheme(this)' {{isChecked}}>
<label for="themeSwitch" class="switch-label">Use Dark Theme</label>
<input type="checkbox" id="torSwitch" name="set-name" class="switch-input" {{isChecked}}>
<label for="torSwitch" class="switch-label">Use TOR for API calls</label>
<label for="torSwitch" class="switch-label">Use Tor for API calls</label>
</div>
<div class='center'>
<div onclick='importSubscriptions()' class='settingsButton'>

View File

@ -4,8 +4,8 @@
<ul>
<li onclick='playVideo("{{videoId}}", "", true); showVideoOptions(this.parentNode.previousSibling);'>Open (New Window)</li>
<li onclick='addSavedVideo("{{videoId}}"); showVideoOptions(this.parentNode.previousSibling);'>Save Video</li>
<a href='https://youtube.com/watch?v={{videoId}}; showVideoOptions(this.parentNode.previousSibling);' ><li>Open in YouTube</li></a>
<a href='https://hooktube.com/watch?v={{videoId}}; showVideoOptions(this.parentNode.previousSibling);' ><li>Open in HookTube</li></a>
<a href='https://youtube.com/watch?v={{videoId}}' ><li>Open in YouTube</li></a>
<a href='https://hooktube.com/watch?v={{videoId}}' ><li>Open in HookTube</li></a>
{{{deleteHtml}}}
</ul>
</div>