Merge branch 'master' of https://github.com/Tzahi12345/YoutubeDL-Material into settings-pin

This commit is contained in:
Isaac Grynsztein
2020-03-20 22:46:06 -04:00
75 changed files with 4673 additions and 13157 deletions

View File

@@ -0,0 +1,735 @@
/**
* @author Phil Teare
* using wikipedia data
* Link: https://stackoverflow.com/a/4900304
*/
export const isoLangs = {
'ab': {
'name': 'Abkhaz',
'nativeName': 'аҧсуа'
},
'aa': {
'name': 'Afar',
'nativeName': 'Afaraf'
},
'af': {
'name': 'Afrikaans',
'nativeName': 'Afrikaans'
},
'ak': {
'name': 'Akan',
'nativeName': 'Akan'
},
'sq': {
'name': 'Albanian',
'nativeName': 'Shqip'
},
'am': {
'name': 'Amharic',
'nativeName': 'አማርኛ'
},
'ar': {
'name': 'Arabic',
'nativeName': 'العربية'
},
'an': {
'name': 'Aragonese',
'nativeName': 'Aragonés'
},
'hy': {
'name': 'Armenian',
'nativeName': 'Հայերեն'
},
'as': {
'name': 'Assamese',
'nativeName': 'অসমীয়া'
},
'av': {
'name': 'Avaric',
'nativeName': 'авар мацӀ, магӀарул мацӀ'
},
'ae': {
'name': 'Avestan',
'nativeName': 'avesta'
},
'ay': {
'name': 'Aymara',
'nativeName': 'aymar aru'
},
'az': {
'name': 'Azerbaijani',
'nativeName': 'azərbaycan dili'
},
'bm': {
'name': 'Bambara',
'nativeName': 'bamanankan'
},
'ba': {
'name': 'Bashkir',
'nativeName': 'башҡорт теле'
},
'eu': {
'name': 'Basque',
'nativeName': 'euskara, euskera'
},
'be': {
'name': 'Belarusian',
'nativeName': 'Беларуская'
},
'bn': {
'name': 'Bengali',
'nativeName': 'বাংলা'
},
'bh': {
'name': 'Bihari',
'nativeName': 'भोजपुरी'
},
'bi': {
'name': 'Bislama',
'nativeName': 'Bislama'
},
'bs': {
'name': 'Bosnian',
'nativeName': 'bosanski jezik'
},
'br': {
'name': 'Breton',
'nativeName': 'brezhoneg'
},
'bg': {
'name': 'Bulgarian',
'nativeName': 'български език'
},
'my': {
'name': 'Burmese',
'nativeName': 'ဗမာစာ'
},
'ca': {
'name': 'Catalan; Valencian',
'nativeName': 'Català'
},
'ch': {
'name': 'Chamorro',
'nativeName': 'Chamoru'
},
'ce': {
'name': 'Chechen',
'nativeName': 'нохчийн мотт'
},
'ny': {
'name': 'Chichewa; Chewa; Nyanja',
'nativeName': 'chiCheŵa, chinyanja'
},
'zh': {
'name': 'Chinese',
'nativeName': '中文 (Zhōngwén), 汉语, 漢語'
},
'cv': {
'name': 'Chuvash',
'nativeName': 'чӑваш чӗлхи'
},
'kw': {
'name': 'Cornish',
'nativeName': 'Kernewek'
},
'co': {
'name': 'Corsican',
'nativeName': 'corsu, lingua corsa'
},
'cr': {
'name': 'Cree',
'nativeName': 'ᓀᐦᐃᔭᐍᐏᐣ'
},
'hr': {
'name': 'Croatian',
'nativeName': 'hrvatski'
},
'cs': {
'name': 'Czech',
'nativeName': 'česky, čeština'
},
'da': {
'name': 'Danish',
'nativeName': 'dansk'
},
'dv': {
'name': 'Divehi; Dhivehi; Maldivian;',
'nativeName': 'ދިވެހި'
},
'nl': {
'name': 'Dutch',
'nativeName': 'Nederlands, Vlaams'
},
'en': {
'name': 'English',
'nativeName': 'English'
},
'eo': {
'name': 'Esperanto',
'nativeName': 'Esperanto'
},
'et': {
'name': 'Estonian',
'nativeName': 'eesti, eesti keel'
},
'ee': {
'name': 'Ewe',
'nativeName': 'Eʋegbe'
},
'fo': {
'name': 'Faroese',
'nativeName': 'føroyskt'
},
'fj': {
'name': 'Fijian',
'nativeName': 'vosa Vakaviti'
},
'fi': {
'name': 'Finnish',
'nativeName': 'suomi, suomen kieli'
},
'fr': {
'name': 'French',
'nativeName': 'français, langue française'
},
'ff': {
'name': 'Fula; Fulah; Pulaar; Pular',
'nativeName': 'Fulfulde, Pulaar, Pular'
},
'gl': {
'name': 'Galician',
'nativeName': 'Galego'
},
'ka': {
'name': 'Georgian',
'nativeName': 'ქართული'
},
'de': {
'name': 'German',
'nativeName': 'Deutsch'
},
'el': {
'name': 'Greek, Modern',
'nativeName': 'Ελληνικά'
},
'gn': {
'name': 'Guaraní',
'nativeName': 'Avañeẽ'
},
'gu': {
'name': 'Gujarati',
'nativeName': 'ગુજરાતી'
},
'ht': {
'name': 'Haitian; Haitian Creole',
'nativeName': 'Kreyòl ayisyen'
},
'ha': {
'name': 'Hausa',
'nativeName': 'Hausa, هَوُسَ'
},
'he': {
'name': 'Hebrew (modern)',
'nativeName': 'עברית'
},
'hz': {
'name': 'Herero',
'nativeName': 'Otjiherero'
},
'hi': {
'name': 'Hindi',
'nativeName': 'हिन्दी, हिंदी'
},
'ho': {
'name': 'Hiri Motu',
'nativeName': 'Hiri Motu'
},
'hu': {
'name': 'Hungarian',
'nativeName': 'Magyar'
},
'ia': {
'name': 'Interlingua',
'nativeName': 'Interlingua'
},
'id': {
'name': 'Indonesian',
'nativeName': 'Bahasa Indonesia'
},
'ie': {
'name': 'Interlingue',
'nativeName': 'Originally called Occidental; then Interlingue after WWII'
},
'ga': {
'name': 'Irish',
'nativeName': 'Gaeilge'
},
'ig': {
'name': 'Igbo',
'nativeName': 'Asụsụ Igbo'
},
'ik': {
'name': 'Inupiaq',
'nativeName': 'Iñupiaq, Iñupiatun'
},
'io': {
'name': 'Ido',
'nativeName': 'Ido'
},
'is': {
'name': 'Icelandic',
'nativeName': 'Íslenska'
},
'it': {
'name': 'Italian',
'nativeName': 'Italiano'
},
'iu': {
'name': 'Inuktitut',
'nativeName': 'ᐃᓄᒃᑎᑐᑦ'
},
'ja': {
'name': 'Japanese',
'nativeName': '日本語 (にほんご/にっぽんご)'
},
'jv': {
'name': 'Javanese',
'nativeName': 'basa Jawa'
},
'kl': {
'name': 'Kalaallisut, Greenlandic',
'nativeName': 'kalaallisut, kalaallit oqaasii'
},
'kn': {
'name': 'Kannada',
'nativeName': 'ಕನ್ನಡ'
},
'kr': {
'name': 'Kanuri',
'nativeName': 'Kanuri'
},
'ks': {
'name': 'Kashmiri',
'nativeName': 'कश्मीरी, كشميري‎'
},
'kk': {
'name': 'Kazakh',
'nativeName': 'Қазақ тілі'
},
'km': {
'name': 'Khmer',
'nativeName': 'ភាសាខ្មែរ'
},
'ki': {
'name': 'Kikuyu, Gikuyu',
'nativeName': 'Gĩkũyũ'
},
'rw': {
'name': 'Kinyarwanda',
'nativeName': 'Ikinyarwanda'
},
'ky': {
'name': 'Kirghiz, Kyrgyz',
'nativeName': 'кыргыз тили'
},
'kv': {
'name': 'Komi',
'nativeName': 'коми кыв'
},
'kg': {
'name': 'Kongo',
'nativeName': 'KiKongo'
},
'ko': {
'name': 'Korean',
'nativeName': '한국어 (韓國語), 조선말 (朝鮮語)'
},
'ku': {
'name': 'Kurdish',
'nativeName': 'Kurdî, كوردی‎'
},
'kj': {
'name': 'Kwanyama, Kuanyama',
'nativeName': 'Kuanyama'
},
'la': {
'name': 'Latin',
'nativeName': 'latine, lingua latina'
},
'lb': {
'name': 'Luxembourgish, Letzeburgesch',
'nativeName': 'Lëtzebuergesch'
},
'lg': {
'name': 'Luganda',
'nativeName': 'Luganda'
},
'li': {
'name': 'Limburgish, Limburgan, Limburger',
'nativeName': 'Limburgs'
},
'ln': {
'name': 'Lingala',
'nativeName': 'Lingála'
},
'lo': {
'name': 'Lao',
'nativeName': 'ພາສາລາວ'
},
'lt': {
'name': 'Lithuanian',
'nativeName': 'lietuvių kalba'
},
'lu': {
'name': 'Luba-Katanga',
'nativeName': ''
},
'lv': {
'name': 'Latvian',
'nativeName': 'latviešu valoda'
},
'gv': {
'name': 'Manx',
'nativeName': 'Gaelg, Gailck'
},
'mk': {
'name': 'Macedonian',
'nativeName': 'македонски јазик'
},
'mg': {
'name': 'Malagasy',
'nativeName': 'Malagasy fiteny'
},
'ms': {
'name': 'Malay',
'nativeName': 'bahasa Melayu, بهاس ملايو‎'
},
'ml': {
'name': 'Malayalam',
'nativeName': 'മലയാളം'
},
'mt': {
'name': 'Maltese',
'nativeName': 'Malti'
},
'mi': {
'name': 'Māori',
'nativeName': 'te reo Māori'
},
'mr': {
'name': 'Marathi (Marāṭhī)',
'nativeName': 'मराठी'
},
'mh': {
'name': 'Marshallese',
'nativeName': 'Kajin M̧ajeļ'
},
'mn': {
'name': 'Mongolian',
'nativeName': 'монгол'
},
'na': {
'name': 'Nauru',
'nativeName': 'Ekakairũ Naoero'
},
'nv': {
'name': 'Navajo, Navaho',
'nativeName': 'Diné bizaad, Dinékʼehǰí'
},
'nb': {
'name': 'Norwegian Bokmål',
'nativeName': 'Norsk bokmål'
},
'nd': {
'name': 'North Ndebele',
'nativeName': 'isiNdebele'
},
'ne': {
'name': 'Nepali',
'nativeName': 'नेपाली'
},
'ng': {
'name': 'Ndonga',
'nativeName': 'Owambo'
},
'nn': {
'name': 'Norwegian Nynorsk',
'nativeName': 'Norsk nynorsk'
},
'no': {
'name': 'Norwegian',
'nativeName': 'Norsk'
},
'ii': {
'name': 'Nuosu',
'nativeName': 'ꆈꌠ꒿ Nuosuhxop'
},
'nr': {
'name': 'South Ndebele',
'nativeName': 'isiNdebele'
},
'oc': {
'name': 'Occitan',
'nativeName': 'Occitan'
},
'oj': {
'name': 'Ojibwe, Ojibwa',
'nativeName': 'ᐊᓂᔑᓈᐯᒧᐎᓐ'
},
'cu': {
'name': 'Old Church Slavonic, Church Slavic, Church Slavonic, Old Bulgarian, Old Slavonic',
'nativeName': 'ѩзыкъ словѣньскъ'
},
'om': {
'name': 'Oromo',
'nativeName': 'Afaan Oromoo'
},
'or': {
'name': 'Oriya',
'nativeName': 'ଓଡ଼ିଆ'
},
'os': {
'name': 'Ossetian, Ossetic',
'nativeName': 'ирон æвзаг'
},
'pa': {
'name': 'Panjabi, Punjabi',
'nativeName': 'ਪੰਜਾਬੀ, پنجابی‎'
},
'pi': {
'name': 'Pāli',
'nativeName': 'पाऴि'
},
'fa': {
'name': 'Persian',
'nativeName': 'فارسی'
},
'pl': {
'name': 'Polish',
'nativeName': 'polski'
},
'ps': {
'name': 'Pashto, Pushto',
'nativeName': 'پښتو'
},
'pt': {
'name': 'Portuguese',
'nativeName': 'Português'
},
'qu': {
'name': 'Quechua',
'nativeName': 'Runa Simi, Kichwa'
},
'rm': {
'name': 'Romansh',
'nativeName': 'rumantsch grischun'
},
'rn': {
'name': 'Kirundi',
'nativeName': 'kiRundi'
},
'ro': {
'name': 'Romanian, Moldavian, Moldovan',
'nativeName': 'română'
},
'ru': {
'name': 'Russian',
'nativeName': 'русский язык'
},
'sa': {
'name': 'Sanskrit (Saṁskṛta)',
'nativeName': 'संस्कृतम्'
},
'sc': {
'name': 'Sardinian',
'nativeName': 'sardu'
},
'sd': {
'name': 'Sindhi',
'nativeName': 'सिन्धी, سنڌي، سندھی‎'
},
'se': {
'name': 'Northern Sami',
'nativeName': 'Davvisámegiella'
},
'sm': {
'name': 'Samoan',
'nativeName': 'gagana faa Samoa'
},
'sg': {
'name': 'Sango',
'nativeName': 'yângâ tî sängö'
},
'sr': {
'name': 'Serbian',
'nativeName': 'српски језик'
},
'gd': {
'name': 'Scottish Gaelic; Gaelic',
'nativeName': 'Gàidhlig'
},
'sn': {
'name': 'Shona',
'nativeName': 'chiShona'
},
'si': {
'name': 'Sinhala, Sinhalese',
'nativeName': 'සිංහල'
},
'sk': {
'name': 'Slovak',
'nativeName': 'slovenčina'
},
'sl': {
'name': 'Slovene',
'nativeName': 'slovenščina'
},
'so': {
'name': 'Somali',
'nativeName': 'Soomaaliga, af Soomaali'
},
'st': {
'name': 'Southern Sotho',
'nativeName': 'Sesotho'
},
'es': {
'name': 'Spanish; Castilian',
'nativeName': 'español'
},
'su': {
'name': 'Sundanese',
'nativeName': 'Basa Sunda'
},
'sw': {
'name': 'Swahili',
'nativeName': 'Kiswahili'
},
'ss': {
'name': 'Swati',
'nativeName': 'SiSwati'
},
'sv': {
'name': 'Swedish',
'nativeName': 'svenska'
},
'ta': {
'name': 'Tamil',
'nativeName': 'தமிழ்'
},
'te': {
'name': 'Telugu',
'nativeName': 'తెలుగు'
},
'tg': {
'name': 'Tajik',
'nativeName': 'тоҷикӣ, toğikī, تاجیکی‎'
},
'th': {
'name': 'Thai',
'nativeName': 'ไทย'
},
'ti': {
'name': 'Tigrinya',
'nativeName': 'ትግርኛ'
},
'bo': {
'name': 'Tibetan Standard, Tibetan, Central',
'nativeName': 'བོད་ཡིག'
},
'tk': {
'name': 'Turkmen',
'nativeName': 'Türkmen, Түркмен'
},
'tl': {
'name': 'Tagalog',
'nativeName': 'Wikang Tagalog, ᜏᜒᜃᜅ᜔ ᜆᜄᜎᜓᜄ᜔'
},
'tn': {
'name': 'Tswana',
'nativeName': 'Setswana'
},
'to': {
'name': 'Tonga (Tonga Islands)',
'nativeName': 'faka Tonga'
},
'tr': {
'name': 'Turkish',
'nativeName': 'Türkçe'
},
'ts': {
'name': 'Tsonga',
'nativeName': 'Xitsonga'
},
'tt': {
'name': 'Tatar',
'nativeName': 'татарча, tatarça, تاتارچا‎'
},
'tw': {
'name': 'Twi',
'nativeName': 'Twi'
},
'ty': {
'name': 'Tahitian',
'nativeName': 'Reo Tahiti'
},
'ug': {
'name': 'Uighur, Uyghur',
'nativeName': 'Uyƣurqə, ئۇيغۇرچە‎'
},
'uk': {
'name': 'Ukrainian',
'nativeName': 'українська'
},
'ur': {
'name': 'Urdu',
'nativeName': 'اردو'
},
'uz': {
'name': 'Uzbek',
'nativeName': 'zbek, Ўзбек, أۇزبېك‎'
},
've': {
'name': 'Venda',
'nativeName': 'Tshivenḓa'
},
'vi': {
'name': 'Vietnamese',
'nativeName': 'Tiếng Việt'
},
'vo': {
'name': 'Volapük',
'nativeName': 'Volapük'
},
'wa': {
'name': 'Walloon',
'nativeName': 'Walon'
},
'cy': {
'name': 'Welsh',
'nativeName': 'Cymraeg'
},
'wo': {
'name': 'Wolof',
'nativeName': 'Wollof'
},
'fy': {
'name': 'Western Frisian',
'nativeName': 'Frysk'
},
'xh': {
'name': 'Xhosa',
'nativeName': 'isiXhosa'
},
'yi': {
'name': 'Yiddish',
'nativeName': 'ייִדיש'
},
'yo': {
'name': 'Yoruba',
'nativeName': 'Yorùbá'
},
'za': {
'name': 'Zhuang, Chuang',
'nativeName': 'Saɯ cueŋƅ, Saw cuengh'
}
};

View File

@@ -1,25 +1,34 @@
<h4 mat-dialog-title>Settings</h4>
<h4 i18n="Settings title" mat-dialog-title>Settings</h4>
<!-- <ng-container i18n="Allow subscriptions setting"></ng-container> -->
<mat-dialog-content>
<!-- Language -->
<div>
Language:&nbsp;&nbsp;&nbsp;<mat-select class="locale-select" (selectionChange)="localeSelectChanged($event.value)" [(value)]="initialLocale">
<mat-option *ngFor="let locale of supported_locales" [value]="locale">
{{all_locales[locale]['nativeName']}}
</mat-option>
</mat-select>
</div>
<!-- Host -->
<mat-expansion-panel class="settings-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>
Host
<ng-container i18n="Host settings title">Host</ng-container>
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngIf="new_config" class="container-fluid">
<div class="row">
<div class="col-12">
<mat-form-field color="accent">
<input [(ngModel)]="new_config['Host']['url']" matInput placeholder="URL" required>
<mat-hint>Base URL this app will be accessed from, without the port.</mat-hint>
<input [(ngModel)]="new_config['Host']['url']" matInput placeholder="URL" i18n-placeholder="URL input placeholder" required>
<mat-hint><ng-container i18n="URL setting input hint">URL this app will be accessed from, without the port.</ng-container></mat-hint>
</mat-form-field>
</div>
<div class="col-12 mt-4">
<mat-form-field color="accent">
<input [(ngModel)]="new_config['Host']['port']" matInput placeholder="Port" required>
<mat-hint>The desired port. Default is 17442.</mat-hint>
<input [(ngModel)]="new_config['Host']['port']" matInput placeholder="Port" i18n-placeholder="Port input placeholder" required>
<mat-hint><ng-container i18n="Port setting input hint">The desired port. Default is 17442.</ng-container></mat-hint>
</mat-form-field>
</div>
@@ -31,24 +40,24 @@
<mat-expansion-panel class="settings-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>
Encryption
<ng-container i18n="Encryption settings title">Encryption</ng-container>
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngIf="new_config" class="container-fluid">
<div class="row">
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Encryption']['use-encryption']">Use encryption</mat-checkbox>
<mat-checkbox color="accent" [(ngModel)]="new_config['Encryption']['use-encryption']"><ng-container i18n="Use encryption setting">Use encryption</ng-container></mat-checkbox>
</div>
<div class="col-12">
<mat-form-field color="accent">
<input [disabled]="!new_config['Encryption']['use-encryption']" [(ngModel)]="new_config['Encryption']['cert-file-path']" matInput placeholder="Cert file path">
<input [disabled]="!new_config['Encryption']['use-encryption']" [(ngModel)]="new_config['Encryption']['cert-file-path']" matInput placeholder="Cert file path" i18n-placeholder="Cert file path input placeholder">
</mat-form-field>
</div>
<div class="col-12">
<mat-form-field color="accent">
<input [disabled]="!new_config['Encryption']['use-encryption']" [(ngModel)]="new_config['Encryption']['key-file-path']" matInput placeholder="Key file path">
<input [disabled]="!new_config['Encryption']['use-encryption']" [(ngModel)]="new_config['Encryption']['key-file-path']" matInput placeholder="Key file path" i18n-placeholder="Key file path input placeholder">
</mat-form-field>
</div>
</div>
@@ -59,30 +68,36 @@
<mat-expansion-panel class="settings-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>
Downloader
<ng-container i18n="Downloader settings title">Downloader</ng-container>
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngIf="new_config" class="container-fluid">
<div class="row">
<div class="col-12">
<mat-form-field color="accent">
<input matInput [(ngModel)]="new_config['Downloader']['path-audio']" placeholder="Audio folder path" required>
<mat-hint>Path for audio only downloads. It is relative to YTDL-Material's root folder.</mat-hint>
<input matInput [(ngModel)]="new_config['Downloader']['path-audio']" placeholder="Audio folder path" i18n-placeholder="Audio folder path input placeholder" required>
<mat-hint><ng-container i18n="Aduio path setting input hint">Path for audio only downloads. It is relative to YTDL-Material's root folder.</ng-container></mat-hint>
</mat-form-field>
</div>
<div class="col-12 mt-4">
<mat-form-field color="accent">
<input matInput [(ngModel)]="new_config['Downloader']['path-video']" placeholder="Video folder path" required>
<mat-hint>Path for video downloads. It is relative to YTDL-Material's root folder.</mat-hint>
<input matInput [(ngModel)]="new_config['Downloader']['path-video']" placeholder="Video folder path" i18n-placeholder="Video folder path input placeholder" required>
<mat-hint><ng-container i18n="Video path setting input hint">Path for video downloads. It is relative to YTDL-Material's root folder.</ng-container></mat-hint>
</mat-form-field>
</div>
<div class="col-12 mt-4">
<mat-form-field color="accent">
<textarea matInput [(ngModel)]="new_config['Downloader']['custom_args']" placeholder="Custom args"></textarea>
<mat-hint>Global custom args for downloads on the home page.</mat-hint>
<textarea matInput [(ngModel)]="new_config['Downloader']['custom_args']" placeholder="Custom args" i18n-placeholder="Custom args input placeholder"></textarea>
<mat-hint><ng-container i18n="Custom args setting input hint">Global custom args for downloads on the home page.</ng-container></mat-hint>
</mat-form-field>
<button style="margin-left: 12px;" (click)="openArgsModifierDialog()" mat-stroked-button>Modify args</button>
</div>
<div class="col-12 mt-4">
<mat-checkbox color="accent" [(ngModel)]="new_config['Downloader']['use_youtubedl_archive']"><ng-container i18n="Use youtubedl archive setting">Use youtube-dl archive</ng-container></mat-checkbox>
<p>Note: This setting only applies to downloads on the Home page. If you would like to use youtube-dl archive functionality in subscriptions, head down to the Subscriptions section.</p>
</div>
</div>
</div>
@@ -92,28 +107,28 @@
<mat-expansion-panel class="settings-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>
Extra
<ng-container i18n="Extra settings title">Extra</ng-container>
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngIf="new_config" class="container-fluid">
<div class="row">
<div class="col-12">
<mat-form-field color="accent">
<input [(ngModel)]="new_config['Extra']['title_top']" matInput placeholder="Top title" required>
<input [(ngModel)]="new_config['Extra']['title_top']" matInput placeholder="Top title" i18n-placeholder="Top title input placeholder" required>
<mat-hint></mat-hint>
</mat-form-field>
</div>
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Extra']['file_manager_enabled']">File manager enabled</mat-checkbox>
<mat-checkbox color="accent" [(ngModel)]="new_config['Extra']['file_manager_enabled']"><ng-container i18n="File manager enabled setting">File manager enabled</ng-container></mat-checkbox>
</div>
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Extra']['allow_quality_select']">Allow quality select</mat-checkbox>
<mat-checkbox color="accent" [(ngModel)]="new_config['Extra']['allow_quality_select']"><ng-container i18n="Allow quality seelct setting">Allow quality select</ng-container></mat-checkbox>
</div>
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Extra']['download_only_mode']">Download only mode</mat-checkbox>
<mat-checkbox color="accent" [(ngModel)]="new_config['Extra']['download_only_mode']"><ng-container i18n="Download only mode setting">Download only mode</ng-container></mat-checkbox>
</div>
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Extra']['allow_multi_download_mode']">Allow multi-download mode</mat-checkbox>
<mat-checkbox color="accent" [(ngModel)]="new_config['Extra']['allow_multi_download_mode']"><ng-container i18n="Allow multi-downloade mode setting">Allow multi-download mode</ng-container></mat-checkbox>
</div>
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Extra']['settings_pin_required']">Require pin for settings</mat-checkbox>
@@ -127,18 +142,18 @@
<mat-expansion-panel class="settings-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>
API
<ng-container i18n="API settings title">API</ng-container>
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngIf="new_config" class="container-fluid">
<div class="row">
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['API']['use_youtube_api']">Use YouTube API</mat-checkbox>
<mat-checkbox color="accent" [(ngModel)]="new_config['API']['use_youtube_API']"><ng-container i18n="Use YouTube API setting">Use YouTube API</ng-container></mat-checkbox>
</div>
<div class="col-12">
<mat-form-field color="accent">
<input [disabled]="!new_config['API']['use_youtube_api']" [(ngModel)]="new_config['API']['youtube_API_key']" matInput placeholder="Youtube API Key" required>
<mat-hint><a target="_blank" href="https://developers.google.com/youtube/v3/getting-started">Generating a key</a> is easy!</mat-hint>
<input [disabled]="!new_config['API']['use_youtube_API']" [(ngModel)]="new_config['API']['youtube_API_key']" matInput placeholder="Youtube API Key" i18n-placeholder="Youtube API Key setting placeholder" required>
<mat-hint><a target="_blank" href="https://developers.google.com/youtube/v3/getting-started"><ng-container i18n="Youtube API Key setting hint">Generating a key is easy!</ng-container></a></mat-hint>
</mat-form-field>
</div>
</div>
@@ -149,20 +164,20 @@
<mat-expansion-panel class="settings-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>
Themes
<ng-container i18n="Themes settings title">Themes</ng-container>
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngIf="new_config" class="container-fluid">
<div class="row">
<div class="col-12">
<mat-select color="accent" style="width: 100px" [(ngModel)]="new_config['Themes']['default_theme']">
<mat-option value="default">Default</mat-option>
<mat-option value="dark">Dark</mat-option>
<mat-option value="default"><ng-container i18n="Default theme label">Default</ng-container></mat-option>
<mat-option value="dark"><ng-container i18n="Dark theme label">Dark</ng-container></mat-option>
</mat-select>
</div>
<div class="col-12 mt-4">
<mat-checkbox color="accent" [(ngModel)]="new_config['Themes']['allow_theme_change']">Allow theme change</mat-checkbox>
<mat-checkbox color="accent" [(ngModel)]="new_config['Themes']['allow_theme_change']"><ng-container i18n="Allow theme change setting">Allow theme change</ng-container></mat-checkbox>
</div>
</div>
</div>
@@ -172,55 +187,93 @@
<mat-expansion-panel class="settings-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>
Subscriptions
<ng-container i18n="Subscriptions settings title">Subscriptions</ng-container>
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngIf="new_config" class="container-fluid">
<div class="row">
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Subscriptions']['allow_subscriptions']">Allow subscriptions</mat-checkbox>
<mat-checkbox color="accent" [(ngModel)]="new_config['Subscriptions']['allow_subscriptions']"><ng-container i18n="Allow subscriptions setting">Allow subscriptions</ng-container></mat-checkbox>
</div>
<div class="col-12">
<mat-form-field color="accent">
<input [disabled]="!new_config['Subscriptions']['allow_subscriptions']" [(ngModel)]="new_config['Subscriptions']['subscriptions_base_path']" matInput placeholder="Subscriptions base path">
<mat-hint>Base path for videos from your subscribed channels and playlists. It is relative to YTDL-Material's root folder.</mat-hint>
<input [disabled]="!new_config['Subscriptions']['allow_subscriptions']" [(ngModel)]="new_config['Subscriptions']['subscriptions_base_path']" matInput placeholder="Subscriptions base path" i18n-placeholder="Subscriptions base path input setting placeholder">
<mat-hint><ng-container i18n="Subscriptions base path setting input hint">Base path for videos from your subscribed channels and playlists. It is relative to YTDL-Material's root folder.</ng-container></mat-hint>
</mat-form-field>
</div>
<div class="col-12 mt-5">
<mat-form-field color="accent">
<input [disabled]="!new_config['Subscriptions']['allow_subscriptions']" [(ngModel)]="new_config['Subscriptions']['subscriptions_check_interval']" matInput placeholder="Check interval">
<mat-hint>Unit is seconds, only include numbers.</mat-hint>
<input [disabled]="!new_config['Subscriptions']['allow_subscriptions']" [(ngModel)]="new_config['Subscriptions']['subscriptions_check_interval']" matInput placeholder="Check interval" i18n-placeholder="Check interval input setting placeholder">
<mat-hint><ng-container i18n="Check interval setting input hint">Unit is seconds, only include numbers.</ng-container></mat-hint>
</mat-form-field>
</div>
<div class="col-12 mt-4">
<mat-checkbox color="accent" [disabled]="!new_config['Subscriptions']['allow_subscriptions']" [(ngModel)]="new_config['Subscriptions']['subscriptions_use_youtubedl_archive']">Use youtube-dl archive</mat-checkbox>
<p>With youtube-dl's <a target="_blank" href="https://github.com/ytdl-org/youtube-dl/blob/master/README.md#how-do-i-download-only-new-videos-from-a-playlist">archive</a> feature, downloaded videos from your subscriptions get recorded in a text file in the subscriptions <i>archive</i> sub-directory.</p>
<p>This enables the ability to permanently delete videos from your subscriptions without unsubscribing, and allows you to record which videos you downloaded in case of data loss.</p>
<mat-checkbox color="accent" [disabled]="!new_config['Subscriptions']['allow_subscriptions']" [(ngModel)]="new_config['Subscriptions']['subscriptions_use_youtubedl_archive']"><ng-container i18n="Use youtube-dl archive setting">Use youtube-dl archive</ng-container></mat-checkbox>
<p><a target="_blank" href="https://github.com/ytdl-org/youtube-dl/blob/master/README.md#how-do-i-download-only-new-videos-from-a-playlist"><ng-container i18n="youtube-dl archive explanation prefix link">With youtube-dl's archive</ng-container></a>&nbsp;<ng-container i18n="youtube-dl archive explanation middle">feature, downloaded videos from your subscriptions get recorded in a text file in the subscriptions archive sub-directory.</ng-container></p>
<p><ng-container i18n="youtube-dl archive explanation suffix">This enables the ability to permanently delete videos from your subscriptions without unsubscribing, and allows you to record which videos you downloaded in case of data loss.</ng-container></p>
</div>
</div>
</div>
</mat-expansion-panel>
<!-- Advanced -->
<!-- Extensions -->
<mat-expansion-panel class="settings-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>
Advanced
<ng-container i18n="Extensions settings title">Extensions</ng-container>
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngIf="new_config" class="container-fluid">
<div class="row">
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Advanced']['use_default_downloading_agent']">Use default downloading agent</mat-checkbox>
<h6>Chrome</h6>
<p><a href="https://github.com/Tzahi12345/YoutubeDL-Material/blob/master/chrome-extension/youtubedl-material-chrome-extension.zip?raw=true"><ng-container i18n="Chrome ext click here">Click here</ng-container></a>&nbsp;<ng-container i18n="Chrome click here suffix">to download the official YoutubeDL-Material Chrome extension manually.</ng-container></p>
<p><ng-container i18n="Chrome setup suffix">You must manually load the extension and modify the extension's settings to set the frontend URL.</ng-container></p>
<mat-divider class="ext-divider"></mat-divider>
</div>
<div class="col-12">
<mat-form-field color="accent">
<input [disabled]="new_config['Advanced']['use_default_downloading_agent']" [(ngModel)]="new_config['Advanced']['custom_downloading_agent']" matInput placeholder="Custom agent" required>
<mat-hint></mat-hint>
</mat-form-field>
<h6>Firefox</h6>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/youtubedl-material/" target="_blank"><ng-container i18n="Firefox ext click here">Click here</ng-container></a>&nbsp;<ng-container i18n="Firefox click here suffix">to install the official YoutubeDL-Material Firefox extension right off the Firefox extensions page.</ng-container></p>
<p><a href="https://github.com/Tzahi12345/YoutubeDL-Material/wiki/Firefox-Extension" target="_blank"><ng-container i18n="Firefox setup prefix link">Detailed setup instructions.</ng-container></a>&nbsp;<ng-container i18n="Firefox setup suffix">Not much is required other than changing the extension's settings to set the frontend URL.</ng-container></p>
<mat-divider class="ext-divider"></mat-divider>
</div>
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Advanced']['allow_advanced_download']">Allow advanced download</mat-checkbox>
<h6>Bookmarklet</h6>
<p><ng-container i18n="Bookmarklet instructions">Drag the link below to your bookmarks, and you're good to go! Just navigate to the YouTube video you'd like to download, and click the bookmark.</ng-container></p>
<!--<button style="margin-bottom: 5px;" mat-stroked-button color="accent" (click)="generateBookmarklet()">Generate bookmarklet</button>-->
<p><a [href]="generated_bookmarklet_code" target="_blank">YTDL-Bookmarklet</a></p>
</div>
</div>
</div>
</mat-expansion-panel>
<!-- Advanced -->
<mat-expansion-panel class="settings-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>
<ng-container i18n="Advanced settings title">Advanced</ng-container>
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngIf="new_config" class="container-fluid">
<div class="row">
<div class="col-12">
<mat-checkbox color="accent" [(ngModel)]="new_config['Advanced']['use_default_downloading_agent']"><ng-container i18n="Use default downloading agent setting">Use default downloading agent</ng-container></mat-checkbox>
</div>
<div class="col-12 my-2">
<mat-select [disabled]="new_config['Advanced']['use_default_downloading_agent']" color="accent" style="width: 200px" [(ngModel)]="new_config['Advanced']['custom_downloading_agent']">
<mat-option value="">Select a downloader</mat-option>
<mat-option value="aria2c">aria2c</mat-option>
<mat-option value="avconv">avconv</mat-option>
<mat-option value="axel">axel</mat-option>
<mat-option value="curl">curl</mat-option>
<mat-option value="ffmpeg">ffmpeg</mat-option>
<mat-option value="httpie">httpie</mat-option>
<mat-option value="wget">wget</mat-option>
</mat-select>
</div>
<div class="col-12 mt-2">
<mat-checkbox color="accent" [(ngModel)]="new_config['Advanced']['allow_advanced_download']"><ng-container i18n="Allow advanced downloading setting">Allow advanced download</ng-container></mat-checkbox>
</div>
</div>
</div>
@@ -229,7 +282,11 @@
<mat-dialog-actions>
<div style="margin-bottom: 10px;">
<button color="accent" (click)="saveSettings()" [disabled]="settingsSame()" mat-raised-button><mat-icon>done</mat-icon>&nbsp;&nbsp;Save</button>
<button mat-flat-button [mat-dialog-close]="false"><mat-icon>cancel</mat-icon>&nbsp;&nbsp;Cancel</button>
<button color="accent" (click)="saveSettings()" [disabled]="settingsSame()" mat-raised-button><mat-icon>done</mat-icon>&nbsp;&nbsp;
<ng-container i18n="Settings save button">Save</ng-container>
</button>
<button mat-flat-button [mat-dialog-close]="false"><mat-icon>cancel</mat-icon>&nbsp;&nbsp;
<ng-container i18n="Settings cancel button">Cancel</ng-container>
</button>
</div>
</mat-dialog-actions>

View File

@@ -1,3 +1,12 @@
.settings-expansion-panel {
margin-bottom: 20px;
}
.locale-select {
margin-bottom: 10px;
width: 130px;
}
.ext-divider {
margin-bottom: 14px;
}

View File

@@ -1,7 +1,11 @@
import { Component, OnInit } from '@angular/core';
import { PostsService } from 'app/posts.services';
import { MatDialog } from '@angular/material';
import { CheckOrSetPinDialogComponent } from 'app/dialogs/check-or-set-pin-dialog/check-or-set-pin-dialog.component';
import { isoLangs } from './locales_list';
import { MatSnackBar } from '@angular/material/snack-bar';
import {DomSanitizer} from '@angular/platform-browser';
import { MatDialog } from '@angular/material/dialog';
import { ArgModifierDialogComponent } from 'app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component';
@Component({
selector: 'app-settings',
@@ -9,15 +13,22 @@ import { CheckOrSetPinDialogComponent } from 'app/dialogs/check-or-set-pin-dialo
styleUrls: ['./settings.component.scss']
})
export class SettingsComponent implements OnInit {
all_locales = isoLangs;
supported_locales = ['en', 'es'];
initialLocale = localStorage.getItem('locale');
initial_config = null;
new_config = null
loading_config = false;
generated_bookmarklet_code = null;
constructor(private postsService: PostsService, private dialog: MatDialog) { }
constructor(private postsService: PostsService, private snackBar: MatSnackBar, private sanitizer: DomSanitizer,
private dialog: MatDialog) { }
ngOnInit() {
this.getConfig();
this.generated_bookmarklet_code = this.sanitizer.bypassSecurityTrustUrl(this.generateBookmarkletCode());
}
getConfig() {
@@ -56,4 +67,62 @@ export class SettingsComponent implements OnInit {
});
}
localeSelectChanged(new_val) {
localStorage.setItem('locale', new_val);
this.openSnackBar('Language successfully changed! Reload to update the page.')
}
generateBookmarklet() {
this.bookmarksite('YTDL-Material', this.generated_bookmarklet_code);
}
generateBookmarkletCode() {
const currentURL = window.location.href.split('#')[0];
const homePageWithArgsURL = currentURL + '#/home;url=';
const bookmarkletCodeInside = `'${homePageWithArgsURL}' + window.location`
const bookmarkletCode = `javascript:(function()%7Bwindow.open('${homePageWithArgsURL}' + encodeURIComponent(window.location))%7D)()`;
return bookmarkletCode;
}
// not currently functioning on most platforms. hence not in use
bookmarksite(title, url) {
// Internet Explorer
if (document.all) {
window['external']['AddFavorite'](url, title);
} else if (window['chrome']) {
// Google Chrome
this.openSnackBar('Chrome users must drag the \'Alternate URL\' link to your bookmarks.');
} else if (window['sidebar']) {
// Firefox
window['sidebar'].addPanel(title, url, '');
} else if (window['opera'] && window.print) {
// Opera
const elem = document.createElement('a');
elem.setAttribute('href', url);
elem.setAttribute('title', title);
elem.setAttribute('rel', 'sidebar');
elem.click();
}
}
openArgsModifierDialog() {
const dialogRef = this.dialog.open(ArgModifierDialogComponent, {
data: {
initial_args: this.new_config['Downloader']['custom_args']
}
});
dialogRef.afterClosed().subscribe(new_args => {
if (new_args) {
this.new_config['Downloader']['custom_args'] = new_args;
}
});
}
// snackbar helper
public openSnackBar(message: string, action: string = '') {
this.snackBar.open(message, action, {
duration: 2000,
});
}
}