mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-11 09:41:28 +03:00
Completed deprecation of streamingOnly mode for subscriptions
This commit is contained in:
@@ -1826,7 +1826,6 @@ components:
|
|||||||
required:
|
required:
|
||||||
- name
|
- name
|
||||||
- url
|
- url
|
||||||
- streamingOnly
|
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
@@ -2608,7 +2607,6 @@ components:
|
|||||||
- url
|
- url
|
||||||
- type
|
- type
|
||||||
- user_uid
|
- user_uid
|
||||||
- streamingOnly
|
|
||||||
- isPlaylist
|
- isPlaylist
|
||||||
- videos
|
- videos
|
||||||
type: object
|
type: object
|
||||||
@@ -2624,8 +2622,6 @@ components:
|
|||||||
user_uid:
|
user_uid:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
streamingOnly:
|
|
||||||
type: boolean
|
|
||||||
isPlaylist:
|
isPlaylist:
|
||||||
type: boolean
|
type: boolean
|
||||||
archive:
|
archive:
|
||||||
|
|||||||
@@ -1272,7 +1272,7 @@ app.post('/api/getSubscription', optionalJwt, async (req, res) => {
|
|||||||
subscription = JSON.parse(JSON.stringify(subscription));
|
subscription = JSON.parse(JSON.stringify(subscription));
|
||||||
|
|
||||||
// get sub videos
|
// get sub videos
|
||||||
if (subscription.name && !subscription.streamingOnly) {
|
if (subscription.name) {
|
||||||
var parsed_files = await db_api.getRecords('files', {sub_id: subscription.id}); // subscription.videos;
|
var parsed_files = await db_api.getRecords('files', {sub_id: subscription.id}); // subscription.videos;
|
||||||
subscription['videos'] = parsed_files;
|
subscription['videos'] = parsed_files;
|
||||||
// loop through files for extra processing
|
// loop through files for extra processing
|
||||||
@@ -1282,19 +1282,6 @@ app.post('/api/getSubscription', optionalJwt, async (req, res) => {
|
|||||||
if (file && file['url'].includes('twitch.tv')) file['chat_exists'] = fs.existsSync(file['path'].substring(0, file['path'].length - 4) + '.twitch_chat.json');
|
if (file && file['url'].includes('twitch.tv')) file['chat_exists'] = fs.existsSync(file['path'].substring(0, file['path'].length - 4) + '.twitch_chat.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
res.send({
|
|
||||||
subscription: subscription,
|
|
||||||
files: parsed_files
|
|
||||||
});
|
|
||||||
} else if (subscription.name && subscription.streamingOnly) {
|
|
||||||
// return list of videos
|
|
||||||
let parsed_files = [];
|
|
||||||
if (subscription.videos) {
|
|
||||||
for (let i = 0; i < subscription.videos.length; i++) {
|
|
||||||
const video = subscription.videos[i];
|
|
||||||
parsed_files.push(new utils.File(video.title, video.title, video.thumbnail, false, video.duration, video.url, video.uploader, video.size, null, null, video.upload_date, video.view_count, video.height, video.abr));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res.send({
|
res.send({
|
||||||
subscription: subscription,
|
subscription: subscription,
|
||||||
files: parsed_files
|
files: parsed_files
|
||||||
|
|||||||
@@ -389,11 +389,6 @@ async function generateArgsForSubscription(sub, user_uid, redownload = false, de
|
|||||||
downloadConfig.push('--download-archive', archive_path);
|
downloadConfig.push('--download-archive', archive_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if streaming only mode, just get the list of videos
|
|
||||||
if (sub.streamingOnly) {
|
|
||||||
downloadConfig = ['-f', 'best', '--dump-json'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sub.timerange && !redownload) {
|
if (sub.timerange && !redownload) {
|
||||||
downloadConfig.push('--dateafter', sub.timerange);
|
downloadConfig.push('--dateafter', sub.timerange);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ export type Subscription = {
|
|||||||
id: string;
|
id: string;
|
||||||
type: FileType;
|
type: FileType;
|
||||||
user_uid: string | null;
|
user_uid: string | null;
|
||||||
streamingOnly: boolean;
|
|
||||||
isPlaylist: boolean;
|
isPlaylist: boolean;
|
||||||
archive?: string;
|
archive?: string;
|
||||||
timerange?: string;
|
timerange?: string;
|
||||||
|
|||||||
@@ -215,18 +215,9 @@ export class RecentVideosComponent implements OnInit {
|
|||||||
navigateToFile(file: DatabaseFile, new_tab: boolean): void {
|
navigateToFile(file: DatabaseFile, new_tab: boolean): void {
|
||||||
localStorage.setItem('player_navigator', this.router.url);
|
localStorage.setItem('player_navigator', this.router.url);
|
||||||
if (file.sub_id) {
|
if (file.sub_id) {
|
||||||
const sub = this.postsService.getSubscriptionByID(file.sub_id);
|
|
||||||
if (sub.streamingOnly) {
|
|
||||||
// streaming only mode subscriptions
|
|
||||||
// !new_tab ? this.router.navigate(['/player', {name: file.id,
|
|
||||||
// url: file.requested_formats ? file.requested_formats[0].url : file.url}])
|
|
||||||
// : window.open(`/#/player;name=${file.id};url=${file.requested_formats ? file.requested_formats[0].url : file.url}`);
|
|
||||||
} else {
|
|
||||||
// normal subscriptions
|
|
||||||
!new_tab ? this.router.navigate(['/player', {uid: file.uid,
|
!new_tab ? this.router.navigate(['/player', {uid: file.uid,
|
||||||
type: file.isAudio ? 'audio' : 'video'}])
|
type: file.isAudio ? 'audio' : 'video'}])
|
||||||
: window.open(`/#/player;uid=${file.uid};type=${file.isAudio ? 'audio' : 'video'}`);
|
: window.open(`/#/player;uid=${file.uid};type=${file.isAudio ? 'audio' : 'video'}`);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// normal files
|
// normal files
|
||||||
!new_tab ? this.router.navigate(['/player', {type: file.isAudio ? 'audio' : 'video', uid: file.uid}])
|
!new_tab ? this.router.navigate(['/player', {type: file.isAudio ? 'audio' : 'video', uid: file.uid}])
|
||||||
|
|||||||
@@ -34,11 +34,6 @@
|
|||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 mt-1">
|
|
||||||
<div>
|
|
||||||
<mat-checkbox [disabled]="new_sub.type === 'audio'" [(ngModel)]="new_sub.streamingOnly"><ng-container i18n="Streaming-only mode">Streaming-only mode</ng-container></mat-checkbox>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 mb-3">
|
<div class="col-12 mb-3">
|
||||||
<mat-form-field color="accent">
|
<mat-form-field color="accent">
|
||||||
<input [(ngModel)]="new_sub.custom_args" matInput placeholder="Custom args" i18n-placeholder="Subscription custom args placeholder">
|
<input [(ngModel)]="new_sub.custom_args" matInput placeholder="Custom args" i18n-placeholder="Subscription custom args placeholder">
|
||||||
|
|||||||
@@ -47,11 +47,6 @@
|
|||||||
<mat-checkbox [(ngModel)]="audioOnlyMode"><ng-container i18n="Streaming-only mode">Audio-only mode</ng-container></mat-checkbox>
|
<mat-checkbox [(ngModel)]="audioOnlyMode"><ng-container i18n="Streaming-only mode">Audio-only mode</ng-container></mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
|
||||||
<div>
|
|
||||||
<mat-checkbox [disabled]="audioOnlyMode" [(ngModel)]="streamingOnlyMode"><ng-container i18n="Streaming-only mode">Streaming-only mode</ng-container></mat-checkbox>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 mb-3">
|
<div class="col-12 mb-3">
|
||||||
<mat-form-field color="accent">
|
<mat-form-field color="accent">
|
||||||
<input [(ngModel)]="customArgs" matInput placeholder="Custom args" i18n-placeholder="Subscription custom args placeholder">
|
<input [(ngModel)]="customArgs" matInput placeholder="Custom args" i18n-placeholder="Subscription custom args placeholder">
|
||||||
|
|||||||
@@ -21,9 +21,6 @@ export class SubscribeDialogComponent implements OnInit {
|
|||||||
// state
|
// state
|
||||||
subscribing = false;
|
subscribing = false;
|
||||||
|
|
||||||
// no videos actually downloaded, just streamed
|
|
||||||
streamingOnlyMode = false;
|
|
||||||
|
|
||||||
// audio only mode
|
// audio only mode
|
||||||
audioOnlyMode = false;
|
audioOnlyMode = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user