mirror of
https://github.com/iptv-org/database.git
synced 2025-05-09 19:20:01 -04:00
Update scripts
This commit is contained in:
parent
058aef0f70
commit
78a1e288cc
3 changed files with 10 additions and 2 deletions
|
@ -185,12 +185,14 @@ async function blockChannels({ loader }: { loader: IssueLoader }) {
|
||||||
if (found) return
|
if (found) return
|
||||||
|
|
||||||
const channel = data.getString('channel_id')
|
const channel = data.getString('channel_id')
|
||||||
|
const reason = data.getString('reason')?.toLowerCase()
|
||||||
const ref = data.getString('ref')
|
const ref = data.getString('ref')
|
||||||
if (!channel || !ref) return
|
if (!channel || !reason || !ref) return
|
||||||
|
|
||||||
blocklist.push(
|
blocklist.push(
|
||||||
new Blocked({
|
new Blocked({
|
||||||
channel,
|
channel,
|
||||||
|
reason,
|
||||||
ref
|
ref
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
type BlockedProps = {
|
type BlockedProps = {
|
||||||
channel: string
|
channel: string
|
||||||
|
reason: string
|
||||||
ref: string
|
ref: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Blocked {
|
export class Blocked {
|
||||||
channel: string
|
channel: string
|
||||||
|
reason: string
|
||||||
ref: string
|
ref: string
|
||||||
|
|
||||||
constructor({ ref, channel }: BlockedProps) {
|
constructor({ ref, reason, channel }: BlockedProps) {
|
||||||
this.channel = channel
|
this.channel = channel
|
||||||
|
this.reason = reason
|
||||||
this.ref = ref
|
this.ref = ref
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,5 +4,8 @@ export default {
|
||||||
channel: Joi.string()
|
channel: Joi.string()
|
||||||
.regex(/^[A-Za-z0-9]+\.[a-z]{2}$/)
|
.regex(/^[A-Za-z0-9]+\.[a-z]{2}$/)
|
||||||
.required(),
|
.required(),
|
||||||
|
reason: Joi.string()
|
||||||
|
.valid(...['dmca', 'nsfw'])
|
||||||
|
.required(),
|
||||||
ref: Joi.string().uri().required()
|
ref: Joi.string().uri().required()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue