Commit 597e2907 authored by PrestonN's avatar PrestonN
Browse files

Merge branch 'development'

parents f91fffd3 6c5f506c
......@@ -27,7 +27,7 @@ saved videos are stored locally on your computer and never sent out. Using a VP
to hide your IP while using FreeTube.
## Screenshots
<img src="https://freetubeapp.github.io/images/FreeTube1.png" width=200> <img src="https://freetubeapp.github.io/images/FreeTube2.png" width=200> <img src="https://freetubeapp.github.io/images/FreeTube3.png" width=200> <img src="https://freetubeapp.github.io/images/FreeTube5.png" width=200>
<img src="https://freetubeapp.io/images/FreeTube1.png" width=200> <img src="https://freetubeapp.io/images/FreeTube2.png" width=200> <img src="https://freetubeapp.io/images/FreeTube3.png" width=200> <img src="https://freetubeapp.io/images/FreeTube4.png" width=200>
## Features
* Watch videos without ads
......@@ -55,10 +55,18 @@ Thank you very much to the [People and Projects](https://github.com/FreeTubeApp/
## Contact
If you ever have any questions, feel free to make an issue here on GitHub. Alternatively, you can email me at FreeTubeApp@protonmail.com or you can join our [Matrix Server](https://riot.im/app/#/room/#freetube:matrix.org). Don't forget to check out the [rules](https://github.com/FreeTubeApp/FreeTube/wiki/Matrix-Server-Info-&-Rules) before joining.
If you ever have any questions, feel free to make an issue here on GitHub. Alternatively, you can email me at FreeTubeApp@protonmail.com or you can join our [Matrix Community](https://riot.im/app/#/group/+freetube:matrix.org). Don't forget to check out the [rules](https://github.com/FreeTubeApp/FreeTube/wiki/Matrix-Server-Info-&-Rules) before joining.
You can also stay up to date by reading the [FreeTube Blog](https://write.as/freetube/). [View the welcome blog](https://write.as/freetube/welcome-to-freetube-blogs).
## Donate
[FreeTube on Liberapay](https://liberapay.com/FreeTube)
Bitcoin Address: 1Lih7Ho5gnxb1CwPD4o59ss78pwo2T91eS
If you enjoy using FreeTube, you're welcome to leave a donation using the following methods. While your donations are much appreciated, only donate if you really want to. Donations are used for keeping the website up and running and eventual code signing costs.
## License
[![GNU GPLv3 Image](https://www.gnu.org/graphics/gplv3-127x51.png)](http://www.gnu.org/licenses/gpl-3.0.en.html)
......
{
"name": "FreeTube",
"version": "0.5.0",
"version": "0.5.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "FreeTube",
"productName": "FreeTube",
"version": "0.5.0",
"version": "0.5.1",
"description": "An Open Source YouTube app for privacy.",
"main": "src/js/init.js",
"scripts": {
......
......@@ -13,6 +13,7 @@
<link rel="stylesheet" href="style/select.css">
<link rel="stylesheet" href="style/fa-solid.min.css">
<link rel="stylesheet" href="style/fontawesome-all.min.css">
<link rel="shortcut icon" href="icons/iconColor.ico" type="image/x-icon" />
<title>FreeTube Player</title>
</head>
......
......@@ -105,6 +105,8 @@ function showHistory(){
addToHistory(videoData);
videoData.position = index;
displayVideo(videoData, 'history');
}, () => {
removeFromHistory(video.videoId);
});
}
else{
......
......@@ -29,6 +29,8 @@
function playVideo(videoId, playlistId = '') {
hideViews();
let youtubedlFinished = false;
let invidiousFinished = false;
playerView.playerSeen = true;
playerView.firstLoad = true;
playerView.videoId = videoId;
......@@ -119,15 +121,19 @@ function playVideo(videoId, playlistId = '') {
playerView.subtitleHtml = videoHtml;
}
loadingView.seen = false;
youtubedlFinished = true;
if (subscriptionView.seen === false && aboutView.seen === false && headerView.seen === false && searchView.seen === false && settingsView.seen === false && popularView.seen === false && savedView.seen === false && historyView.seen === false && channelView.seen === false && channelVideosView.seen === false) {
playerView.seen = true;
} else {
return;
}
if (youtubedlFinished && invidiousFinished) {
loadingView.seen = false;
if (subscriptionView.seen === false && aboutView.seen === false && headerView.seen === false && searchView.seen === false && settingsView.seen === false && popularView.seen === false && savedView.seen === false && historyView.seen === false && channelView.seen === false && channelVideosView.seen === false) {
playerView.seen = true;
} else {
return;
}
window.setTimeout(checkVideoUrls, 5000, playerView.video480p, playerView.video720p, playerView.videoAudio);
window.setTimeout(checkVideoUrls, 5000, playerView.video480p, playerView.video720p, playerView.videoAudio);
}
});
invidiousAPI('videos', videoId, {}, (data) => {
......@@ -242,6 +248,20 @@ function playVideo(videoId, playlistId = '') {
playerView.playlistId = '';
}
invidiousFinished = true;
if (youtubedlFinished && invidiousFinished) {
loadingView.seen = false;
if (subscriptionView.seen === false && aboutView.seen === false && headerView.seen === false && searchView.seen === false && settingsView.seen === false && popularView.seen === false && savedView.seen === false && historyView.seen === false && channelView.seen === false && channelVideosView.seen === false) {
playerView.seen = true;
} else {
return;
}
window.setTimeout(checkVideoUrls, 5000, playerView.video480p, playerView.video720p, playerView.videoAudio);
}
if (rememberHistory === true){
let historyData = {
videoId: videoId,
......
......@@ -165,6 +165,8 @@ function showSavedVideos() {
videoData.position = index;
displayVideo(videoData, 'saved');
}, () => {
removeSavedVideo(video.videoId);
});
}
else {
......
......@@ -28,6 +28,7 @@ along with FreeTube. If not, see <http://www.gnu.org/licenses/>.
let currentVolume = 1;
let defaultQuality = 720;
let defaultPlaybackRate = '1';
let defaultRegion = 'US';
// Proxy address variable
let defaultProxy = false;
// This variable is to make sure that proxy was set before making any API calls
......@@ -94,6 +95,7 @@ function updateSettingsView() {
document.getElementById('qualitySelect').value = defaultQuality;
document.getElementById('rateSelect').value = defaultPlaybackRate;
document.getElementById('regionSelect').value = defaultRegion;
if(defaultProxy) {
settingsView.proxyAddress = defaultProxy;
......@@ -122,7 +124,8 @@ function checkDefaultSettings() {
'quality': '720',
'rate': '1',
'invidious': 'https://invidio.us',
'proxy': "SOCKS5://127.0.0.1:9050" // This is default value for tor client
'proxy': "SOCKS5://127.0.0.1:9050", // This is default value for tor client
'region': 'US'
};
console.log(settingDefaults);
......@@ -187,6 +190,10 @@ function checkDefaultSettings() {
settingsView.invidiousInstance = docs[0]['value'];
invidiousInstance = docs[0]['value'];
break;
case 'region':
defaultRegion = docs[0]['value'];
settingsView.region = docs[0]['value'];
break;
default:
break;
}
......@@ -209,6 +216,7 @@ function updateSettings() {
let updatesSwitch = document.getElementById('updatesSwitch').checked;
let qualitySelect = document.getElementById('qualitySelect').value;
let rateSelect = document.getElementById('rateSelect').value;
let regionSelect = document.getElementById('regionSelect').value;
let proxyAddress = document.getElementById('proxyAddress').value;
let invidious = document.getElementById('invidiousInstance').value;
let theme = 'light';
......@@ -337,6 +345,17 @@ function updateSettings() {
defaultPlaybackRate = rateSelect;
});
// Update default region.
settingsDb.update({
_id: 'region'
}, {
value: regionSelect
}, {}, function(err, numReplaced) {
console.log(err);
console.log(numReplaced);
settingsView.region = regionSelect;
});
// set proxy in electron based on new values
if(torSwitch) {
electron.ipcRenderer.send("setProxy", proxyAddress);
......@@ -420,7 +439,7 @@ function importOpmlSubs(json){
return;
}
showToast('Importing susbcriptions, please wait.');
showToast('Importing subscriptions, please wait.');
progressView.seen = true;
progressView.width = 0;
......@@ -489,7 +508,11 @@ function importSubscriptions(){
});
return;
}
else if (fileType !== '.db'){
else if( (fileType === '.json') && (data.includes("app_version")) ) {
importNewpipeSubscriptions(data);
return;
}
else if ((fileType !== '.db') && (fileType !=='.json')) {
showToast('Incorrect file type. Import unsuccessful.');
return;
}
......@@ -506,7 +529,44 @@ function importSubscriptions(){
})
});
}
/**
* Import NewPipe Channel Subscriptions
* @return {Void}
*/
function importNewpipeSubscriptions(data){
progressView.seen = true;
progressView.width = 0;
showToast('Importing Newpipe Subscriptions, Please Wait.');
let newpipe, n, link, newpipesub, counter;
newpipe = JSON.parse(data);
counter = 0;
for (n in newpipe.subscriptions) {
link = newpipe.subscriptions[n].url.split("/");
invidiousAPI('channels', link[4], {}, (data)=> {
newpipesub = {
channelId: data.authorId,
channelName: data.author,
channelThumbnail: data.authorThumbnails[2].url
};
addSubscription(newpipesub, false);
counter++;
progressView.progressWidth = (counter / newpipe.subscriptions.length) * 100;
if ((counter + 1) == newpipe.subscriptions.length) {
showToast('Subscriptions have been imported!');
progressView.seen = false;
progressView.seen = 0;
return;
}
});
}
}
/**
* Export the susbcriptions database to a file.
*
......
......@@ -368,6 +368,7 @@ let settingsView = new Vue({
autoplay: true,
subtitles: false,
updates: true,
region: 'US',
proxyAddress: false,
invidiousInstance: 'https://invidio.us',
checkProxyResult: false,
......
......@@ -354,7 +354,7 @@ function showTrending() {
checkTrending = false;
}
invidiousAPI('trending', '', {}, function (data) {
invidiousAPI('trending', '', {region: settingsView.region}, function (data) {
console.log(data);
popularView.videoList = [];
......
......@@ -229,6 +229,10 @@ input[type=text] {
background-color: #212121;
}
#backButton {
color: white;
}
#channelIcon {
border: 0px solid white;
}
......
......@@ -194,6 +194,10 @@ body {
background-color: #e0e0e0;
}
#backButton {
color: #000000;
}
#channelIcon {
border: 0px solid #000000;
}
......
......@@ -124,7 +124,7 @@ a {
}
.searchBar input {
width: 60%;
width: 65%;
}
#searchFilter {
......
......@@ -8,4 +8,6 @@
<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>
<p>If you enjoy using FreeTube, consider donating via <a href='https://liberapay.com/FreeTube'>Liberapay</a> or through our Bitcoin address.</p>
<p>BTC: 1Lih7Ho5gnxb1CwPD4o59ss78pwo2T91eS</p>
</div>
......@@ -39,20 +39,266 @@
<span class="select-bar"></span>
<label class="select-label">Default Video Speed</label>
</div>
<br /><br />
<div class="select center">
<select id='regionSelect' class="select-text" required>
<option value='AF'>Afghanistan</option>
<option value='AL'>Albania</option>
<option value='DZ'>Algeria</option>
<option value='AS'>American Samoa</option>
<option value='AD'>Andorra</option>
<option value='AO'>Angola</option>
<option value='AQ'>Antarctica</option>
<option value='AG'>Antigua And Barbuda</option>
<option value='AR'>Argentina</option>
<option value='AM'>Armenia</option>
<option value='AW'>Aruba</option>
<option value='AU'>Australia</option>
<option value='AT'>Austria</option>
<option value='AZ'>Azerbaijan</option>
<option value='BS'>Bahamas</option>
<option value='BH'>Bahrain</option>
<option value='BD'>Bangladesh</option>
<option value='BB'>Barbados</option>
<option value='BY'>Belarus</option>
<option value='BE'>Belgium</option>
<option value='BZ'>Belize</option>
<option value='BJ'>Benin</option>
<option value='BM'>Bermuda</option>
<option value='BT'>Bhutan</option>
<option value='BO'>Bolivia</option>
<option value='BA'>Bosnia And Herzegovina</option>
<option value='BW'>Botswana</option>
<option value='BV'>Bouvet Island</option>
<option value='BR'>Brazil</option>
<option value='IO'>British Indian Ocean Territory</option>
<option value='BN'>Brunei Darussalam</option>
<option value='BG'>Bulgaria</option>
<option value='BF'>Burkina Faso</option>
<option value='BI'>Burundi</option>
<option value='KH'>Cambodia</option>
<option value='CM'>Cameroon</option>
<option value='CA'>Canada</option>
<option value='CV'>Cape Verde</option>
<option value='KY'>Cayman Islands</option>
<option value='CF'>Central African Republic</option>
<option value='TD'>Chad</option>
<option value='CL'>Chile</option>
<option value='CN'>China</option>
<option value='CX'>Christmas Island</option>
<option value='CC'>Cocos (Keeling) Islands</option>
<option value='CO'>Colombia</option>
<option value='KM'>Comoros</option>
<option value='CG'>Congo</option>
<option value='CD'>Congo, The Democratic Republic Of The</option>
<option value='CK'>Cook Islands</option>
<option value='CR'>Costa Rica</option>
<option value='CI'>Cote D'Ivoire</option>
<option value='HR'>Croatia</option>
<option value='CU'>Cuba</option>
<option value='CY'>Cyprus</option>
<option value='CZ'>Czech Republic</option>
<option value='DK'>Denmark</option>
<option value='DJ'>Djibouti</option>
<option value='DM'>Dominica</option>
<option value='DO'>Dominican Republic</option>
<option value='EC'>Ecuador</option>
<option value='EG'>Egypt</option>
<option value='SV'>El Salvador</option>
<option value='GQ'>Equatorial Guinea</option>
<option value='ER'>Eritrea</option>
<option value='EE'>Estonia</option>
<option value='ET'>Ethiopia</option>
<option value='FK'>Falkland Islands (Malvinas)</option>
<option value='FO'>Faroe Islands</option>
<option value='FJ'>Fiji</option>
<option value='FI'>Finland</option>
<option value='FR'>France</option>
<option value='GF'>French Guiana</option>
<option value='PF'>French Polynesia</option>
<option value='TF'>French Southern Territories</option>
<option value='GA'>Gabon</option>
<option value='GM'>Gambia</option>
<option value='GE'>Georgia</option>
<option value='DE'>Germany</option>
<option value='GH'>Ghana</option>
<option value='GI'>Gibraltar</option>
<option value='GR'>Greece</option>
<option value='GL'>Greenland</option>
<option value='GD'>Grenada</option>
<option value='GP'>Guadeloupe</option>
<option value='GU'>Guam</option>
<option value='GT'>Guatamala</option>
<option value='GN'>Guinea</option>
<option value='GW'>Guinea-Bissau</option>
<option value='GY'>Guyana</option>
<option value='HT'>Haiti</option>
<option value='HM'>Heard Island And McDonald Islands</option>
<option value='HN'>Honduras</option>
<option value='HK'>Hong Kong</option>
<option value='HU'>Hungary</option>
<option value='IS'>Iceland</option>
<option value='IN'>India</option>
<option value='ID'>Indonesia</option>
<option value='IR'>Iran, Islamic Republic Of</option>
<option value='IQ'>Iraq</option>
<option value='IE'>Ireland</option>
<option value='IL'>Israel</option>
<option value='IT'>Italy</option>
<option value='JM'>Jamaica</option>
<option value='JP'>Japan</option>
<option value='JO'>Jordan</option>
<option value='KZ'>Kazakhstan</option>
<option value='KE'>Kenya</option>
<option value='KI'>Kiribati</option>
<option value='KP'>Korea, Democratic People's Republic Of</option>
<option value='KR'>Korea, Republic Of</option>
<option value='KW'>Kuwait</option>
<option value='KG'>Kyrgyzstan</option>
<option value='LA'>Lao People's Democratic Republic (LAOS)</option>
<option value='LV'>Latvia</option>
<option value='LB'>Lebonon</option>
<option value='LS'>Lesotho</option>
<option value='LR'>Liberia</option>
<option value='LY'>Libyan Arab Jamahiriya</option>
<option value='LI'>Liechtenstein</option>
<option value='LT'>Lithuania</option>
<option value='LU'>Luxembourg</option>
<option value='MO'>Macao</option>
<option value='MK'>Macedonia, The Former Yugoslav Republic Of</option>
<option value='MG'>Madagascar</option>
<option value='MW'>Malawi</option>
<option value='MY'>Malaysia</option>
<option value='MV'>Maldives</option>
<option value='ML'>Mali</option>
<option value='MT'>Malta</option>
<option value='MH'>Marshall Islands</option>
<option value='MQ'>Martinique</option>
<option value='MR'>Mauritania</option>
<option value='MU'>Mauritius</option>
<option value='YT'>Mayotte</option>
<option value='MX'>Mexico</option>
<option value='FM'>Micronesia, Federated States Of</option>
<option value='MD'>Moldova, Republic Of</option>
<option value='MC'>Monaco</option>
<option value='MN'>Mongolia</option>
<option value='ME'>Montenegro</option>
<option value='MS'>Montserrat</option>
<option value='MA'>Morocco</option>
<option value='MZ'>Mozambique</option>
<option value='MM'>Myanmar</option>
<option value='NA'>Namibia</option>
<option value='NR'>Nauru</option>
<option value='NP'>Nepal</option>
<option value='NL'>Netherlands</option>
<option value='AN'>Netherlands Antilles</option>
<option value='NC'>New Caledonia</option>
<option value='NZ'>New Zealand</option>
<option value='NI'>Nicaragua</option>
<option value='NE'>Niger</option>
<option value='NG'>Nigeria</option>
<option value='NU'>Niue</option>
<option value='NF'>Norfolk Island</option>
<option value='MP'>Northern Mariana Islands</option>
<option value='NO'>Norway</option>
<option value='OM'>Oman</option>
<option value='PK'>Pakistan</option>
<option value='PW'>Palau</option>
<option value='PS'>Palestinian Territory, Occupied</option>
<option value='PA'>Panama</option>
<option value='PG'>Papua New Guinea</option>
<option value='PY'>Paraguay</option>
<option value='PE'>Peru</option>
<option value='PH'>Philippines</option>
<option value='PN'>Pitcair</option>
<option value='PL'>Poland</option>
<option value='PT'>Portugal</option>
<option value='PR'>Puerto Rico</option>
<option value='QA'>Qatar</option>
<option value='RE'>Reunion</option>
<option value='RO'>Romania</option>
<option value='RU'>Russian Federation</option>
<option value='RW'>Rwanda</option>
<option value='SH'>Saint Helena</option>
<option value='KN'>Saint Kitts And Nevis</option>
<option value='LC'>Saint Lucia</option>
<option value='PM'>Saint Pierre And Miquelon</option>
<option value='VC'>Saint Vincent And The Grenadines</option>
<option value='WS'>Samoa</option>
<option value='SM'>San Marina</option>
<option value='ST'>Sao Tome And Principe</option>
<option value='SA'>Saudi Arabia</option>
<option value='SN'>Senegal</option>
<option value='RS'>Serbia</option>
<option value='SC'>Seychelles</option>
<option value='SL'>Sierra Leone</option>
<option value='SG'>Singapore</option>
<option value='SK'>Slovakia</option>
<option value='SI'>Slovenia</option>
<option value='SB'>Solomon Islands</option>
<option value='SO'>Somalia</option>
<option value='ZA'>South Africa</option>
<option value='GS'>South Georgia And The South Sandwich Islands</option>
<option value='ES'>Spain</option>
<option value='LK'>Sri Lanka</option>
<option value='SD'>Sudan</option>
<option value='SR'>Suriname</option>
<option value='SJ'>Svalbard And Jan Mayen</option>
<option value='SZ'>Swaziland</option>
<option value='SE'>Sweden</option>
<option value='CH'>Switzerland</option>
<option value='SY'>Syrian Arab Republic</option>
<option value='TW'>Taiwan</option>
<option value='TJ'>Tajikistan</option>
<option value='TZ'>Tanzania, United Republic Of</option>
<option value='TH'>Thailand</option>
<option value='TL'>Timor-Leste</option>
<option value='TG'>Togo</option>
<option value='TK'>Tokelau</option>
<option value='TO'>Tonga</option>
<option value='TT'>Trinidad And Tobago</option>
<option value='TN'>Tunisia</option>
<option value='TR'>Turkey</option>
<option value='TM'>Turkenistan</option>
<option value='TC'>Turks And Caicos Islands</option>
<option value='TV'>Tuvalu</option>
<option value='UG'>Uganda</option>
<option value='UA'>Ukraine</option>
<option value='AE'>United Arab Emirates</option>
<option value='GB'>United Kingdom</option>
<option value='US'>United States</option>
<option value='UM'>United States Minor Outlying Islands</option>
<option value='UY'>Uruguay</option>
<option value='UZ'>Uzbekistan</option>
<option value='VU'>Vanuatu</option>
<option value='VE'>Venezuela</option>
<option value='VN'>Viet Nam</option>
<option value='VG'>Virgin Islands, British</option>
<option value='VI'>Virgin Islands, U.S.</option>
<option value='WF'>Wallis And Futuna</option>
<option value='EH'>Western Sahara</option>
<option value='YE'>Yemen</option>
<option value='ZM'>Zambia</option>
<option value='ZW'>Zimbabwe</option>
</select>
<span class="select-highlight"></span>
<span class="select-bar"></span>
<label class="select-label">Region for Trending</label>
</div>
<br />
</div>
<div class='center'>
<div class="input-text-settings">
<label for="invidiousInstance">Current Invidious Instance (Defaults to https://invidio.us)</label>
<input type="text" id="invidiousInstance" name="set-name" v-model="invidiousInstance">
</div>
<div class="input-text-settings">
<label for="invidiousInstance">Current Invidious Instance (Defaults to https://invidio.us)</label>
<input type="text" id="invidiousInstance" name="set-name" v-model="invidiousInstance">
</div>
</div>
<div class="center">
<input type="checkbox" id="torSwitch" name="set-name" class="switch-input" :checked='useTor'>
<label for="torSwitch" class="switch-label">Use Tor / Proxy for API calls</label>
<div class="input-text-settings">
<label for="proxyAddress">Proxy Address (Example: SOCKS5://127.0.0.1:9050 ): </label>
<input type="text" id="proxyAddress" name="set-name" v-model="proxyAddress">
<input type="text" id="proxyAddress" name="set-name" v-model="proxyAddress">
</div>
<div id="ipInfoSettings" v-if="checkProxyResult">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment