mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-30 20:24:25 +00:00
YouTube : Completed
This commit is contained in:
@@ -6,10 +6,10 @@ export interface ChannelIconInterface {
|
||||
|
||||
export class Channel {
|
||||
name?: string;
|
||||
verified!: boolean;
|
||||
verified?: boolean;
|
||||
id?: string;
|
||||
url?: string;
|
||||
icon!: ChannelIconInterface;
|
||||
icon?: ChannelIconInterface;
|
||||
subscribers?: string;
|
||||
|
||||
constructor(data: any) {
|
||||
@@ -36,7 +36,7 @@ export class Channel {
|
||||
*/
|
||||
iconURL(options = { size: 0 }): string | undefined{
|
||||
if (typeof options.size !== "number" || options.size < 0) throw new Error("invalid icon size");
|
||||
if (!this.icon.url) return undefined;
|
||||
if (!this.icon?.url) return undefined;
|
||||
const def = this.icon.url.split("=s")[1].split("-c")[0];
|
||||
return this.icon.url.replace(`=s${def}-c`, `=s${options.size}-c`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user