Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] chaines-tv.orange.fr #2514

Merged
merged 16 commits into from
Jan 5, 2025
Merged

[Fix] chaines-tv.orange.fr #2514

merged 16 commits into from
Jan 5, 2025

Conversation

BellezaEmporium
Copy link
Contributor

@BellezaEmporium BellezaEmporium commented Dec 17, 2024

Change priority in item title, leading in the test being fixed.
Also add season & episode data when available.

Closes #2395

@BellezaEmporium
Copy link
Contributor Author

BellezaEmporium commented Dec 17, 2024

Another possibility is to get the series' name and the episode's title, and concatenate them when available. Thus, the test would need to be edited.

Instead of "Tête de liste", per the test's expected result, we would get "Esprits criminels - Tête de liste".

(this might lead to an EPG that's clearer to understand).

Furthermore, this would also need another case test, in which a movie is being aired (TF1 does this in "Ciné Dimanche", which airs one blockbuster per Sunday evening).

freearhey
freearhey previously approved these changes Dec 18, 2024
tohenk and others added 9 commits December 18, 2024 21:26
Test:

```sh
npm test -- tvplus.com.tr

> test
> run-script-os tvplus.com.tr

> test:win32
> SET "TZ=Pacific/Nauru" && npx jest --runInBand tvplus.com.tr

 PASS  sites/tvplus.com.tr/tvplus.com.tr.test.js
  √ can generate valid url (4 ms)
  √ can parse response (15 ms)
  √ can handle empty guide

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        3.648 s, estimated 4 s
Ran all test suites matching /tvplus.com.tr/i.
```

Grab:

```sh
npm run grab -- --site=tvplus.com.tr

> grab
> npx tsx scripts/commands/epg/grab.ts --site=tvplus.com.tr

starting...
config:
  output: guide.xml
  maxConnections: 1
  gzip: false
  site: tvplus.com.tr
loading channels...
  found 10 channel(s)
run #1:
  [1/20] tvplus.com.tr (tr) - 24TV.tr - Dec 15, 2024 (22 programs)
  [2/20] tvplus.com.tr (tr) - 24TV.tr - Dec 16, 2024 (19 programs)
  [3/20] tvplus.com.tr (tr) - BabyTV.uk - Dec 16, 2024 (48 programs)
  [4/20] tvplus.com.tr (tr) - BabyTV.uk - Dec 15, 2024 (48 programs)
  [5/20] tvplus.com.tr (tr) - ASpor.tr - Dec 16, 2024 (13 programs)
  [6/20] tvplus.com.tr (tr) - ASpor.tr - Dec 15, 2024 (14 programs)
  [7/20] tvplus.com.tr (tr) - APara.tr - Dec 16, 2024 (31 programs)
  [8/20] tvplus.com.tr (tr) - APara.tr - Dec 15, 2024 (25 programs)
  [9/20] tvplus.com.tr (tr) - AlJazeeraEnglish.qa - Dec 16, 2024 (32 programs)
  [10/20] tvplus.com.tr (tr) - AlJazeeraEnglish.qa - Dec 15, 2024 (32 programs)
  [11/20] tvplus.com.tr (tr) - AlJazeera.qa - Dec 16, 2024 (40 programs)
  [12/20] tvplus.com.tr (tr) - AlJazeera.qa - Dec 15, 2024 (41 programs)
  [13/20] tvplus.com.tr (tr) - AkitTV.tr - Dec 16, 2024 (15 programs)
  [14/20] tvplus.com.tr (tr) - AkitTV.tr - Dec 15, 2024 (12 programs)
  [15/20] tvplus.com.tr (tr) - AHaber.tr - Dec 16, 2024 (27 programs)
  [16/20] tvplus.com.tr (tr) - AHaber.tr - Dec 15, 2024 (19 programs)
  [17/20] tvplus.com.tr (tr) - A2TV.tr - Dec 16, 2024 (11 programs)
  [18/20] tvplus.com.tr (tr) - A2TV.tr - Dec 15, 2024 (11 programs)
  [19/20] tvplus.com.tr (tr) - 360.tr - Dec 16, 2024 (18 programs)
  [20/20] tvplus.com.tr (tr) - 360.tr - Dec 15, 2024 (18 programs)
  saving to "guide.xml"...
  done in 00h 02m 17s
```

Signed-off-by: Toha <tohenk@yahoo.com>
Test:

```sh
npm test -- tvplus.com.tr

> test
> run-script-os tvplus.com.tr

> test:win32
> SET "TZ=Pacific/Nauru" && npx jest --runInBand tvplus.com.tr

 PASS  sites/tvplus.com.tr/tvplus.com.tr.test.js
  √ can generate valid url (4 ms)
  √ can parse response (15 ms)
  √ can handle empty guide

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        3.648 s, estimated 4 s
Ran all test suites matching /tvplus.com.tr/i.
```

Grab:

```sh
npm run grab -- --site=tvplus.com.tr

> grab
> npx tsx scripts/commands/epg/grab.ts --site=tvplus.com.tr

starting...
config:
  output: guide.xml
  maxConnections: 1
  gzip: false
  site: tvplus.com.tr
loading channels...
  found 10 channel(s)
run #1:
  [1/20] tvplus.com.tr (tr) - 24TV.tr - Dec 15, 2024 (22 programs)
  [2/20] tvplus.com.tr (tr) - 24TV.tr - Dec 16, 2024 (19 programs)
  [3/20] tvplus.com.tr (tr) - BabyTV.uk - Dec 16, 2024 (48 programs)
  [4/20] tvplus.com.tr (tr) - BabyTV.uk - Dec 15, 2024 (48 programs)
  [5/20] tvplus.com.tr (tr) - ASpor.tr - Dec 16, 2024 (13 programs)
  [6/20] tvplus.com.tr (tr) - ASpor.tr - Dec 15, 2024 (14 programs)
  [7/20] tvplus.com.tr (tr) - APara.tr - Dec 16, 2024 (31 programs)
  [8/20] tvplus.com.tr (tr) - APara.tr - Dec 15, 2024 (25 programs)
  [9/20] tvplus.com.tr (tr) - AlJazeeraEnglish.qa - Dec 16, 2024 (32 programs)
  [10/20] tvplus.com.tr (tr) - AlJazeeraEnglish.qa - Dec 15, 2024 (32 programs)
  [11/20] tvplus.com.tr (tr) - AlJazeera.qa - Dec 16, 2024 (40 programs)
  [12/20] tvplus.com.tr (tr) - AlJazeera.qa - Dec 15, 2024 (41 programs)
  [13/20] tvplus.com.tr (tr) - AkitTV.tr - Dec 16, 2024 (15 programs)
  [14/20] tvplus.com.tr (tr) - AkitTV.tr - Dec 15, 2024 (12 programs)
  [15/20] tvplus.com.tr (tr) - AHaber.tr - Dec 16, 2024 (27 programs)
  [16/20] tvplus.com.tr (tr) - AHaber.tr - Dec 15, 2024 (19 programs)
  [17/20] tvplus.com.tr (tr) - A2TV.tr - Dec 16, 2024 (11 programs)
  [18/20] tvplus.com.tr (tr) - A2TV.tr - Dec 15, 2024 (11 programs)
  [19/20] tvplus.com.tr (tr) - 360.tr - Dec 16, 2024 (18 programs)
  [20/20] tvplus.com.tr (tr) - 360.tr - Dec 15, 2024 (18 programs)
  saving to "guide.xml"...
  done in 00h 02m 17s
```

Signed-off-by: Toha <tohenk@yahoo.com>
tohenk and others added 2 commits December 18, 2024 21:32
Test:

```sh
npm test -- tvplus.com.tr

> test
> run-script-os tvplus.com.tr

> test:win32
> SET "TZ=Pacific/Nauru" && npx jest --runInBand tvplus.com.tr

 PASS  sites/tvplus.com.tr/tvplus.com.tr.test.js
  √ can generate valid url (4 ms)
  √ can parse response (15 ms)
  √ can handle empty guide

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        3.648 s, estimated 4 s
Ran all test suites matching /tvplus.com.tr/i.
```

Grab:

```sh
npm run grab -- --site=tvplus.com.tr

> grab
> npx tsx scripts/commands/epg/grab.ts --site=tvplus.com.tr

starting...
config:
  output: guide.xml
  maxConnections: 1
  gzip: false
  site: tvplus.com.tr
loading channels...
  found 10 channel(s)
run #1:
  [1/20] tvplus.com.tr (tr) - 24TV.tr - Dec 15, 2024 (22 programs)
  [2/20] tvplus.com.tr (tr) - 24TV.tr - Dec 16, 2024 (19 programs)
  [3/20] tvplus.com.tr (tr) - BabyTV.uk - Dec 16, 2024 (48 programs)
  [4/20] tvplus.com.tr (tr) - BabyTV.uk - Dec 15, 2024 (48 programs)
  [5/20] tvplus.com.tr (tr) - ASpor.tr - Dec 16, 2024 (13 programs)
  [6/20] tvplus.com.tr (tr) - ASpor.tr - Dec 15, 2024 (14 programs)
  [7/20] tvplus.com.tr (tr) - APara.tr - Dec 16, 2024 (31 programs)
  [8/20] tvplus.com.tr (tr) - APara.tr - Dec 15, 2024 (25 programs)
  [9/20] tvplus.com.tr (tr) - AlJazeeraEnglish.qa - Dec 16, 2024 (32 programs)
  [10/20] tvplus.com.tr (tr) - AlJazeeraEnglish.qa - Dec 15, 2024 (32 programs)
  [11/20] tvplus.com.tr (tr) - AlJazeera.qa - Dec 16, 2024 (40 programs)
  [12/20] tvplus.com.tr (tr) - AlJazeera.qa - Dec 15, 2024 (41 programs)
  [13/20] tvplus.com.tr (tr) - AkitTV.tr - Dec 16, 2024 (15 programs)
  [14/20] tvplus.com.tr (tr) - AkitTV.tr - Dec 15, 2024 (12 programs)
  [15/20] tvplus.com.tr (tr) - AHaber.tr - Dec 16, 2024 (27 programs)
  [16/20] tvplus.com.tr (tr) - AHaber.tr - Dec 15, 2024 (19 programs)
  [17/20] tvplus.com.tr (tr) - A2TV.tr - Dec 16, 2024 (11 programs)
  [18/20] tvplus.com.tr (tr) - A2TV.tr - Dec 15, 2024 (11 programs)
  [19/20] tvplus.com.tr (tr) - 360.tr - Dec 16, 2024 (18 programs)
  [20/20] tvplus.com.tr (tr) - 360.tr - Dec 15, 2024 (18 programs)
  saving to "guide.xml"...
  done in 00h 02m 17s
```

Signed-off-by: Toha <tohenk@yahoo.com>
@BellezaEmporium
Copy link
Contributor Author

I've allowed myself to add some additional content that could be useful in the EPG. Feel free to check now.

@PopeyeTheSai10r
Copy link
Collaborator

> npm install

channels.json      [====================================] 100.00% | ETA: 0s | 1.7 MB | 1.9 MB/s
countries.json     [====================================] 100.00% | ETA: 0s | 4.3 KB | N/A
regions.json       [====================================] 100.00% | ETA: 0s | 2.2 KB | N/A
subdivisions.json  [====================================] 100.00% | ETA: 0s | 36.6 KB | N/A

added 56 packages, removed 97 packages, changed 56 packages, and audited 755 packages in 42s
> npx tsx scripts/commands/api/load.ts
116 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (1 moderate, 5 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.


>npm test --- chaines-tv.orange.fr

> test
> run-script-os chaines-tv.orange.fr


> test:win32
> SET "TZ=Pacific/Nauru" && npx jest --runInBand chaines-tv.orange.fr

 FAIL  sites/chaines-tv.orange.fr/chaines-tv.orange.fr.test.js (9.912 s)
  √ can generate valid url (13 ms)
  × can parse response (34 ms)
  √ can handle empty guide (1 ms)

  ● can parse response

    expect(received).toMatchObject(expected)

    - Expected  - 1
    + Received  + 1

    @@ -3,8 +3,8 @@
          "category": "Série Suspense",
          "description": "Un tueur en série prend un plaisir pervers à prévenir les autorités de Tallahassee avant chaque nouveau meurtre. Rossi apprend le décès d'un de ses vieux amis.",
          "image": "https://proxymedia.woopic.com/340/p/169_EMI_9697669.jpg",
          "start": "2021-11-07T23:35:00.000Z",
          "stop": "2021-11-08T00:20:00.000Z",
    -     "title": "Tête de liste",
    +     "title": "Esprits criminels",
        },
      ]

      23 | it('can parse response', () => {
      24 |   const result = parser({ date, channel, content })
    > 25 |   expect(result).toMatchObject([
         |                  ^
      26 |     {
      27 |       start: '2021-11-07T23:35:00.000Z',
      28 |       stop: '2021-11-08T00:20:00.000Z',

      at Object.<anonymous> (sites/chaines-tv.orange.fr/chaines-tv.orange.fr.test.js:25:18)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 2 passed, 3 total
Snapshots:   0 total
Time:        10.581 s, estimated 12 s
Ran all test suites matching /chaines-tv.orange.fr/i.

@BellezaEmporium
Copy link
Contributor Author

The test being in error is the test i've fixed... rather odd.

@PopeyeTheSai10r
Copy link
Collaborator

I believe some of the code isn't compatible with Windows OS.
I spun up a Github codespace instance and ran the tests again. Everything passed.

$ npm install

> postinstall
> npm run api:load


> api:load
> npx tsx scripts/commands/api/load.ts

channels.json      [====================================] 100.00% | ETA: 0s | 1.8 MB | 5.3 KB/s
countries.json     [====================================] 100.00% | ETA: 0s | 4.3 KB | N/A
regions.json       [====================================] 100.00% | ETA: 0s | 2.2 KB | N/A
subdivisions.json  [====================================] 100.00% | ETA: 0s | 36.6 KB | N/A

added 795 packages, and audited 796 packages in 18s

127 packages are looking for funding
  run `npm fund` for details

1 critical severity vulnerability

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.


$ npm test --- chaines-tv.orange.fr

> test
> run-script-os chaines-tv.orange.fr


> test:default
> TZ=Pacific/Nauru npx jest --runInBand chaines-tv.orange.fr

 PASS  sites/chaines-tv.orange.fr/chaines-tv.orange.fr.test.js (5.116 s)
   can generate valid url (2 ms)
   can parse response (2 ms)
   can handle empty guide (1 ms)

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        5.18 s
Ran all test suites matching /chaines-tv.orange.fr/i.

@freearhey
Copy link
Collaborator

@PopeyeTheSai10r In this case, I don't think that's the problem. Otherwise you would have seen a similar error when testing other sites.

Perhaps the bug occurred when downloading the latest version of PR to your computer. Try to compare the line 19 and 20 from here: https://github.com/iptv-org/epg/pull/2514/files with what you have locally. They should be identical.

@PopeyeTheSai10r
Copy link
Collaborator

I completed removed the Github app and local copy of repo, then re-download everything to start fresh.

The test passed when I switched to the branch and ran npm ci followed by npm test --- chaines-tv.orange.fr

@PopeyeTheSai10r PopeyeTheSai10r merged commit 95e9e67 into master Jan 5, 2025
@PopeyeTheSai10r PopeyeTheSai10r deleted the BellezaEmporium-patch-1 branch January 5, 2025 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

chaines-tv.orange.fr
4 participants