Skip to content

Commit da33c6e

Browse files
Hieu Lam - TMAkhangon
Hieu Lam - TMA
andauthored
feature-9005: Provide option of Youtube integration with Privacy Enha… (#9039)
* feature-9005: Provide option of Youtube integration with Privacy Enhanced Mode * feature-9005: Provide option of Youtube integration with Privacy Enhanced Mode * feature-9005: Provide option of Youtube integration with Privacy Enhanced Mode * feature-9005: Provide option of Youtube integration with Privacy Enhanced Mode --------- Co-authored-by: Khang On - TMA <[email protected]>
1 parent ebc0d5d commit da33c6e

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed

Diff for: app/api/video_stream.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,13 @@ def check_extra(obj, data):
291291
if not channel_id:
292292
return
293293
channel = VideoChannel.query.get(channel_id)
294-
if channel.provider not in ['youtube', 'vimeo', 'bbb', 'jitsi']:
294+
if channel.provider not in [
295+
'youtube',
296+
'vimeo',
297+
'bbb',
298+
'jitsi',
299+
'youtube_privacy',
300+
]:
295301
del data['extra']
296302
else:
297303
data['extra'] = {**(obj.extra or {}), **(data.get('extra') or {})}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""empty message
2+
3+
Revision ID: 8b5bcsea1d4c
4+
Revises: 3e8e18c0bebe
5+
Create Date: 2023-08-03 14:18:12.187180
6+
7+
"""
8+
9+
from alembic import op
10+
11+
# revision identifiers, used by Alembic.
12+
revision = '8b5bcsea1d4c'
13+
down_revision = '3e8e18c0bebe'
14+
15+
16+
def upgrade():
17+
op.execute("insert into video_channels (name, provider, url) values('YouTube Privacy', 'youtube_privacy', 'https://youtube-nocookie.com');")
18+
19+
20+
def downgrade():
21+
op.execute("delete from video_channels where provider = 'youtube_privacy';")

Diff for: migrations/versions/rev-2023-08-08-15:14:57-7e91153d66b0_.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""empty message
22
33
Revision ID: 7e91153d66b0
4-
Revises: 3e8e18c0bebe
4+
Revises: 8b5bcsea1d4c
55
Create Date: 2023-08-08 15:14:57.455117
66
77
"""
@@ -12,7 +12,7 @@
1212

1313
# revision identifiers, used by Alembic.
1414
revision = '7e91153d66b0'
15-
down_revision = '3e8e18c0bebe'
15+
down_revision = '8b5bcsea1d4c'
1616

1717

1818
def upgrade():

Diff for: populate_db.py

+7
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ def populate():
390390
create_admin_message_settings()
391391
print('Creating custom placeholders...')
392392
create_custom_placeholders()
393+
393394
get_or_create(
394395
VideoChannel,
395396
provider='jitsi',
@@ -429,6 +430,12 @@ def populate():
429430
name='Libre Work',
430431
defaults={'url': 'https://2d.freiland-potsdam.de/'},
431432
)
433+
get_or_create(
434+
VideoChannel,
435+
provider='youtube_privacy',
436+
name='YouTube Privacy',
437+
defaults={'url': 'https://youtube-nocookie.com'},
438+
)
432439

433440
db.session.commit()
434441

0 commit comments

Comments
 (0)