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

[SwitchTube] Add new extractor #31018

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Conversation

belamenso
Copy link

@belamenso belamenso commented Jun 10, 2022

Before submitting a pull request make sure you have:

  • Searched the bugtracker for similar pull requests
  • Read adding new extractor tutorial
  • Read youtube-dl coding conventions and adjusted the code to meet them
    Mostly, some lines are often longer than 80 columns, and no data point is extracted from more than a single source.
  • Covered the code with tests (note that PRs without tests will be REJECTED)
  • Checked the code with flake8

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

This pull request adds tube.switch.ch, probably the largest Swiss website for universities to share lecture videos.

@belamenso belamenso force-pushed the switchtube branch 3 times, most recently from 7f4e5e6 to 2d0e7d5 Compare June 10, 2022 14:21
Copy link
Contributor

@dirkf dirkf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work!

I've made quite a few suggestions, which is not to say that your originals were necessarily wrong, because Python gives you many ways to do things. Generally the suggestions focus on robustness and using similar code style to other extractors. Also, the suggestions haven't been tested!

I'll enable the workflow tests after you've been through the comments.

youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
@belamenso
Copy link
Author

I updated the code either exactly as suggested or similarly.

@belamenso
Copy link
Author

I believe I was missing from __future__ import unicode_literals. I added it.

@belamenso
Copy link
Author

belamenso commented Jun 20, 2022

Can someone please approve the CI tests? @dirkf

Copy link
Contributor

@dirkf dirkf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nearly there, I think.

youtube_dl/extractor/switchtube.py Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/switchtube.py Outdated Show resolved Hide resolved
@belamenso
Copy link
Author

I implemented the suggestions.

@belamenso belamenso requested a review from dirkf June 25, 2022 19:12
@belamenso
Copy link
Author

Can somebody look into this?

@belamenso
Copy link
Author

SwitchTube has apparently changes the playlist website format, making a large part of this extractor useless.

PLEASE DO NOT MERGE.

I will try to fix it in a week.

@belamenso belamenso changed the title [SwitchTube] Add new extractor WIP: [SwitchTube] Add new extractor Jul 5, 2022
@dirkf dirkf marked this pull request as draft July 10, 2022 09:32
@belamenso belamenso force-pushed the switchtube branch 2 times, most recently from a39b781 to 6be0c71 Compare July 31, 2022 17:50
@belamenso belamenso marked this pull request as ready for review July 31, 2022 18:47
@belamenso
Copy link
Author

I've split the previous SwitchTubeProfileOrChannelIE into SwitchTubeProfileIE (which was not changed on the website) and SwitchTubeChannelIE (which changed). It should work again now.

@belamenso belamenso changed the title WIP: [SwitchTube] Add new extractor [SwitchTube] Add new extractor Jul 31, 2022
… issues (ytdl-org#31153)

* [test] Identify testcase errors better
* [test] Identify download errors better
* [extractor/minds] Linter
* [extractor/aes] Linter
…7b9 (ytdl-org#31170)

* back-port from yt-dlp 8f53dc4, thanks pukkandan
* also support void, improve <</>> precedence, improve expressions in comma-list
* add more tests
dirkf and others added 17 commits September 19, 2022 11:05
* operator ??
* operator ?.
* operator **
* accurate operator functions
* `undefined` handling
* object literals {a: 1, "b": expr}
* more tests for weird JS comparisons: see ytdl-org#31173 (comment).
…#31182)

* based on yt-dlp/yt-dlp@f6ca640, thanks pukkandan
* adds parse support for regexp flags
* add compat_re_Pattern
* improve compat_collections_chain_map
* use class JS_Undefined
* remove unused code
* proposed fix for issue ytdl-org#31131, aligns with yt-dlp

Co-authored-by: dirkf <fieldhouse@gmx.net>
* also ensure compat encoding of error strings
* add NaN
* allow any white-space character for `after_op`
* align with yt-dlp f26af78 (charcodeAt and bitwise overflow)
* allow escaping in regex, fixing player c57c113c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants