This commit is contained in:
pluja 2020-11-04 08:28:34 +01:00
commit c0fc666d83
2 changed files with 38 additions and 19 deletions

View File

@ -64,6 +64,8 @@ Registering has two main reasons:
Admins are allowed to remove restrictions on any page they want. [Check this section](https://github.com/ytorg/Yotter/blob/dev-indep/SELF-HOSTING.md#removing-log-in-restrictions) to learn how.
If you want to use Yotter, it is recommended to self-host your own instance. You can use it for personal use or open it to the world. Self-hosting makes Yotter stronger and gives you full power. See [self hosting guide](https://github.com/ytorg/Yotter/blob/dev-indep/SELF-HOSTING.md).
# Privacy
#### Connections
Yotter cares about your privacy, and for this it will never make any connection to Twitter or Youtube on the client. Every request is proxied through the Yotter server; video streaming, photos, data gathering, scrapping, etc.

View File

@ -7,6 +7,7 @@ import random
import re
import time
import urllib
from multiprocessing import Process
from concurrent.futures import as_completed
import bleach
@ -30,6 +31,7 @@ from app.models import User, twitterPost, ytPost, Post, youtubeFollow, twitterFo
from youtube import comments, utils, channel as ytch, search as yts
from youtube import watch as ytwatch
from youtube import video as ytvid
#########################################
#########################################
@ -443,7 +445,8 @@ def channel(id):
prev_page = "/channel/{q}?s={s}&p={p}".format(q=id, s=sort, p=int(page) - 1)
return render_template('channel.html', form=form, btform=button_form, data=data,
restricted=config['restrictPublicUsage'], config=config, next_page=next_page, prev_page=prev_page)
restricted=config['restrictPublicUsage'], config=config, next_page=next_page,
prev_page=prev_page)
def get_best_urls(urls):
@ -467,6 +470,7 @@ def get_live_urls(urls):
best_urls.append(url)
return best_urls
@app.route('/watch', methods=['GET'])
@login_required
def watch():
@ -484,7 +488,9 @@ def watch():
# Markup description
try:
info['description'] = Markup(bleach.linkify(info['description'].replace("\n", "<br>"))).replace('www.youtube.com', config['serverName']).replace('youtube.com', config['serverName']).replace("/join","")
info['description'] = Markup(bleach.linkify(info['description'].replace("\n", "<br>"))).replace(
'www.youtube.com', config['serverName']).replace('youtube.com', config['serverName']).replace("/join",
"")
except AttributeError or TypeError:
print(info['description'])
@ -679,14 +685,23 @@ def importdata():
flash('No selected file')
return redirect(request.referrer)
else:
importdataasync(file)
return redirect(request.referrer)
return redirect(request.referrer)
def importdataasync(file):
p = Process(target=importdataforprocess, args=(file,))
p.start()
def importdataforprocess(file):
option = request.form['import_format']
if option == 'yotter':
importYotterSubscriptions(file)
elif option == 'youtube':
importYoutubeSubscriptions(file)
return redirect(request.referrer)
return redirect(request.referrer)
@app.route('/deleteme', methods=['GET', 'POST'])
@ -759,7 +774,9 @@ def status():
filen = url_for('static', filename='img/open.png')
caniregister = True
return render_template('status.html', title='STATUS', count=count, max=config['maxInstanceUsers'], file=filen, cani=caniregister)
return render_template('status.html', title='STATUS', count=count, max=config['maxInstanceUsers'], file=filen,
cani=caniregister)
@app.route('/error/<errno>')
def error(errno):