From e3a129878af5dea4bb9f59598afce7337eb926ed Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Thu, 26 Dec 2024 03:10:05 +0300 Subject: [PATCH 1/6] Update streams_remove_approved.js --- .../input/issues/streams_remove_approved.js | 103 +----------------- 1 file changed, 3 insertions(+), 100 deletions(-) diff --git a/tests/__data__/input/issues/streams_remove_approved.js b/tests/__data__/input/issues/streams_remove_approved.js index c65d76b68b..72b09aeaa9 100644 --- a/tests/__data__/input/issues/streams_remove_approved.js +++ b/tests/__data__/input/issues/streams_remove_approved.js @@ -70,7 +70,7 @@ module.exports = [ closed_at: null, author_association: 'CONTRIBUTOR', active_lock_reason: null, - body: '### Stream URL\n\nhttps://ythls.onrender.com/channel/UC40TUSUx490U5uR1lZt3Ajg.m3u8\n\n### Reason\n\nNot loading\n\n### Notes (optional)\n\nOne link (VTV.br) is misspelled.\n\n### Contributing Guide\n\n- [x] I have read [Contributing Guide](https://github.com/iptv-org/iptv/blob/master/CONTRIBUTING.md)', + body: '### Broken Link\n\nhttps://ythls.onrender.com/channel/UC40TUSUx490U5uR1lZt3Ajg.m3u8\n\n### Reason\n\nNot loading\n\n### Notes (optional)\n\nOne link (VTV.br) is misspelled.\n\n### Contributing Guide\n\n- [x] I have read [Contributing Guide](https://github.com/iptv-org/iptv/blob/master/CONTRIBUTING.md)', reactions: { url: 'https://api.github.com/repos/iptv-org/iptv/issues/14151/reactions', total_count: 0, @@ -97,7 +97,7 @@ module.exports = [ id: 1881649602, node_id: 'I_kwDOCWUK8M5wJ7HC', number: 14140, - title: 'Broken: RIK HD Cyprus', + title: 'Broken: Cyprus Channels', user: { login: 'ROBGagn', id: 124619576, @@ -176,7 +176,7 @@ module.exports = [ closed_at: null, author_association: 'NONE', active_lock_reason: null, - body: '### Broken Link\n\nhttp://l6.cloudskep.com/rikcy/rikhd/playlist.m3u8\n\n### What happened to the stream?\n\nNot loading\n\n### Possible Replacement (optional)\n\nhttp://l6.cloudskep.com/rikcy/rikhd/playlist2.m3u8\n\n### Notes (optional)\n\nToken needed...\r\nSame issue with RIK 1 and 2. May happen in the future with ANT1 Cyprus, Sigma and Omega.\n\n### Contributing Guide\n\n- [X] I have read [Contributing Guide](https://github.com/iptv-org/iptv/blob/master/CONTRIBUTING.md)', + body: '### Broken Links\n\nhttp://l6.cloudskep.com/rikcy/rikhd/playlist.m3u8\r\n\r\nhttp://l6.cloudskep.com/rikcy/rik2/playlist.m3u8\n\n### What happened to the stream?\n\nNot loading\n\n### Possible Replacement (optional)\n\nhttp://l6.cloudskep.com/rikcy/rikhd/playlist2.m3u8\n\n### Notes (optional)\n\nToken needed...\r\nSame issue with RIK 1 and 2. May happen in the future with ANT1 Cyprus, Sigma and Omega.\n\n### Contributing Guide\n\n- [X] I have read [Contributing Guide](https://github.com/iptv-org/iptv/blob/master/CONTRIBUTING.md)', reactions: { url: 'https://api.github.com/repos/iptv-org/iptv/issues/14140/reactions', total_count: 0, @@ -193,103 +193,6 @@ module.exports = [ performed_via_github_app: null, state_reason: null }, - { - url: 'https://api.github.com/repos/iptv-org/iptv/issues/14139', - repository_url: 'https://api.github.com/repos/iptv-org/iptv', - labels_url: 'https://api.github.com/repos/iptv-org/iptv/issues/14139/labels{/name}', - comments_url: 'https://api.github.com/repos/iptv-org/iptv/issues/14139/comments', - events_url: 'https://api.github.com/repos/iptv-org/iptv/issues/14139/events', - html_url: 'https://github.com/iptv-org/iptv/issues/14139', - id: 1881648047, - node_id: 'I_kwDOCWUK8M5wJ6uv', - number: 14139, - title: 'Broken: RIK2 Cyprus', - user: { - login: 'ROBGagn', - id: 124619576, - node_id: 'U_kgDOB22LOA', - avatar_url: 'https://avatars.githubusercontent.com/u/124619576?v=4', - gravatar_id: '', - url: 'https://api.github.com/users/ROBGagn', - html_url: 'https://github.com/ROBGagn', - followers_url: 'https://api.github.com/users/ROBGagn/followers', - following_url: 'https://api.github.com/users/ROBGagn/following{/other_user}', - gists_url: 'https://api.github.com/users/ROBGagn/gists{/gist_id}', - starred_url: 'https://api.github.com/users/ROBGagn/starred{/owner}{/repo}', - subscriptions_url: 'https://api.github.com/users/ROBGagn/subscriptions', - organizations_url: 'https://api.github.com/users/ROBGagn/orgs', - repos_url: 'https://api.github.com/users/ROBGagn/repos', - events_url: 'https://api.github.com/users/ROBGagn/events{/privacy}', - received_events_url: 'https://api.github.com/users/ROBGagn/received_events', - type: 'User', - site_admin: false - }, - labels: [ - { - id: 1707513547, - node_id: 'MDU6TGFiZWwxNzA3NTEzNTQ3', - url: 'https://api.github.com/repos/iptv-org/iptv/labels/broken%20stream', - name: 'broken stream', - color: 'FBCA04', - default: false, - description: 'Stream is not working properly' - }, - { - id: 3241837512, - node_id: 'MDU6TGFiZWwzMjQxODM3NTEy', - url: 'https://api.github.com/repos/iptv-org/iptv/labels/CY', - name: 'CY', - color: '90FA7B', - default: false, - description: 'Cyprus' - }, - { - id: 5923498886, - node_id: 'LA_kwDOCWUK8M8AAAABYRFrhg', - url: 'https://api.github.com/repos/iptv-org/iptv/labels/approved', - name: 'approved', - color: '85ddde', - default: false, - description: '' - }, - { - id: 5932506810, - node_id: 'LA_kwDOCWUK8M8AAAABYZreug', - url: 'https://api.github.com/repos/iptv-org/iptv/labels/streams:remove', - name: 'streams:remove', - color: '5373a2', - default: false, - description: '' - } - ], - state: 'open', - locked: false, - assignee: null, - assignees: [], - milestone: null, - comments: 0, - created_at: '2023-09-05T10:08:08Z', - updated_at: '2023-09-07T00:50:06Z', - closed_at: null, - author_association: 'NONE', - active_lock_reason: null, - body: '### Broken Link\n\nhttp://l6.cloudskep.com/rikcy/rik2/playlist.m3u8\n\n### What happened to the stream?\n\nNot loading\n\n### Possible Replacement (optional)\n\n_No response_\n\n### Notes (optional)\n\nToken needed...\r\nSame issue with RIK 1 and HD. May happen in the future with ANT1 Cyprus, Sigma and Omega.\n\n### Contributing Guide\n\n- [X] I have read [Contributing Guide](https://github.com/iptv-org/iptv/blob/master/CONTRIBUTING.md)', - reactions: { - url: 'https://api.github.com/repos/iptv-org/iptv/issues/14139/reactions', - total_count: 0, - '+1': 0, - '-1': 0, - laugh: 0, - hooray: 0, - confused: 0, - heart: 0, - rocket: 0, - eyes: 0 - }, - timeline_url: 'https://api.github.com/repos/iptv-org/iptv/issues/14139/timeline', - performed_via_github_app: null, - state_reason: null - }, { url: 'https://api.github.com/repos/iptv-org/iptv/issues/14138', repository_url: 'https://api.github.com/repos/iptv-org/iptv', From 82db906fa7144fa9b75cd210765b99882be9960a Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Thu, 26 Dec 2024 03:10:09 +0300 Subject: [PATCH 2/6] Update update.test.ts --- tests/commands/playlist/update.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/commands/playlist/update.test.ts b/tests/commands/playlist/update.test.ts index d607e74584..14bd8a119b 100644 --- a/tests/commands/playlist/update.test.ts +++ b/tests/commands/playlist/update.test.ts @@ -25,9 +25,7 @@ it('can format playlists', () => { ) }) - expect(stdout).toBe( - 'OUTPUT=closes #14151, closes #14140, closes #14139, closes #14110, closes #14178\n' - ) + expect(stdout).toBe('OUTPUT=closes #14151, closes #14140, closes #14110, closes #14178\n') }) function content(filepath: string) { From 44a56464976761733b9fd9b542529d8d09745007 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Thu, 26 Dec 2024 03:10:22 +0300 Subject: [PATCH 3/6] Update issueParser.ts --- scripts/core/issueParser.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/core/issueParser.ts b/scripts/core/issueParser.ts index def939cd23..6d46589852 100644 --- a/scripts/core/issueParser.ts +++ b/scripts/core/issueParser.ts @@ -7,7 +7,8 @@ const FIELDS = new Dictionary({ 'Stream URL': 'stream_url', 'Stream URL (optional)': 'stream_url', 'Stream URL (required)': 'stream_url', - 'Broken Link': 'stream_url', + 'Broken Link': 'broken_links', + 'Broken Links': 'broken_links', Label: 'label', Quality: 'quality', Timeshift: 'timeshift', @@ -27,8 +28,10 @@ export class IssueParser { const data = new Dictionary() fields.forEach((field: string) => { - let [_label, , _value] = field.split(/\r?\n/) + let parsed = field.split(/\r?\n/).filter(Boolean) + let _label = parsed.shift() _label = _label ? _label.trim() : '' + let _value = parsed.join('\r\n') _value = _value ? _value.trim() : '' if (!_label || !_value) return data From 149f7b1d7a49fe920c71ce2153baef2b7e2fb365 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Thu, 26 Dec 2024 03:10:30 +0300 Subject: [PATCH 4/6] Update create.ts --- scripts/commands/report/create.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/commands/report/create.ts b/scripts/commands/report/create.ts index 030a10d60a..74b73f6100 100644 --- a/scripts/commands/report/create.ts +++ b/scripts/commands/report/create.ts @@ -82,7 +82,7 @@ async function main() { logger.info('checking broken streams reports...') const brokenStreamReports = await loader.load({ labels: ['broken stream'] }) brokenStreamReports.forEach((issue: Issue) => { - const streamUrl = issue.data.get('stream_url') || undefined + const brokenLinks = issue.data.get('broken_links') || undefined const result = new Dictionary({ issueNumber: issue.number, @@ -91,8 +91,8 @@ async function main() { status: undefined }) - if (!streamUrl) result.set('status', 'missing_link') - else if (groupedStreams.missing(streamUrl)) result.set('status', 'invalid_link') + if (!brokenLinks) result.set('status', 'missing_link') + else if (groupedStreams.missing(brokenLinks)) result.set('status', 'invalid_link') else result.set('status', 'pending') report.add(result.data()) From 5149cb8173ad0110d82239029e7e6737f00e512d Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Thu, 26 Dec 2024 03:10:36 +0300 Subject: [PATCH 5/6] Update update.ts --- scripts/commands/playlist/update.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/commands/playlist/update.ts b/scripts/commands/playlist/update.ts index 97e461ee7e..4a869f33b6 100644 --- a/scripts/commands/playlist/update.ts +++ b/scripts/commands/playlist/update.ts @@ -54,13 +54,20 @@ async function removeStreams(loader: IssueLoader) { const issues = await loader.load({ labels: ['streams:remove', 'approved'] }) issues.forEach((issue: Issue) => { const data = issue.data - if (data.missing('stream_url')) return + if (data.missing('broken_links')) return - const found: Stream = streams.first((_stream: Stream) => _stream.url === data.get('stream_url')) - if (found) { - found.removed = true - processedIssues.add(issue.number) - } + const brokenLinks = data.get('broken_links').split(/\r?\n/).filter(Boolean) + + let changed = false + brokenLinks.forEach(link => { + const found: Stream = streams.first((_stream: Stream) => _stream.url === link.trim()) + if (found) { + found.removed = true + changed = true + } + }) + + if (changed) processedIssues.add(issue.number) }) } From 775730b333472942fae125c62882760b9efab79b Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Thu, 26 Dec 2024 03:10:50 +0300 Subject: [PATCH 6/6] Update --broken-stream.yml --- .github/ISSUE_TEMPLATE/--broken-stream.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/--broken-stream.yml b/.github/ISSUE_TEMPLATE/--broken-stream.yml index bbfde78b88..12ed63a5b2 100644 --- a/.github/ISSUE_TEMPLATE/--broken-stream.yml +++ b/.github/ISSUE_TEMPLATE/--broken-stream.yml @@ -9,10 +9,10 @@ body: value: | Please fill out the issue template as much as you can so we could efficiently process your request - - type: input + - type: textarea attributes: - label: Broken Link - description: Please specify the broken link from a playlist + label: Broken Links + description: Please specify the broken links from the playlist (one per line) placeholder: 'https://lnc-kdfw-fox-aws.tubi.video/index.m3u8' validations: required: true