mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-23 13:10:59 +03:00
merged new checkbox for bookmarklet: enables ability to set bookmarklet to audio only
fixed two bugs for audio only files: sometimes downloads failed as extensions were improperly removed and readded, removing a single character from the filename. Fixed another extension-related bug where metadata from deleted audio files persisted
This commit is contained in:
@@ -7,6 +7,7 @@ import {DomSanitizer} from '@angular/platform-browser';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ArgModifierDialogComponent } from 'app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component';
|
||||
import { CURRENT_VERSION } from 'app/consts';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
@@ -22,6 +23,7 @@ export class SettingsComponent implements OnInit {
|
||||
new_config = null
|
||||
loading_config = false;
|
||||
generated_bookmarklet_code = null;
|
||||
bookmarkletAudioOnly = false;
|
||||
|
||||
_settingsSame = true;
|
||||
|
||||
@@ -96,11 +98,17 @@ export class SettingsComponent implements OnInit {
|
||||
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)()`;
|
||||
const audioOnly = this.bookmarkletAudioOnly;
|
||||
// tslint:disable-next-line: max-line-length
|
||||
const bookmarkletCode = `javascript:(function()%7Bwindow.open('${homePageWithArgsURL}' + encodeURIComponent(window.location) + ';audioOnly=${audioOnly}')%7D)()`;
|
||||
return bookmarkletCode;
|
||||
}
|
||||
|
||||
bookmarkletAudioOnlyChanged(event: MatCheckboxChange): void {
|
||||
this.bookmarkletAudioOnly = event.checked;
|
||||
this.generated_bookmarklet_code = this.sanitizer.bypassSecurityTrustUrl(this.generateBookmarkletCode());
|
||||
}
|
||||
|
||||
// not currently functioning on most platforms. hence not in use
|
||||
bookmarksite(title, url) {
|
||||
// Internet Explorer
|
||||
|
||||
Reference in New Issue
Block a user