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

[ARDMediathekBridge] Switch to JSON-API #2380

Merged
merged 5 commits into from
Jan 10, 2022
Merged

Conversation

Mar-Koeh
Copy link
Contributor

The html screen scraping approach of ARDMediathekBridge did not work reliably. I could not find one show for which the item list was not empty using the html screen scraping approach.

The proposed change uses the JSON-API of the WebApp. Although there is still room for improvement (feed title, better understanding of the API, more accurate mimic of the webapp's behavior, de-pagination …), it does work with this change.

The html screen scraping approach of ARDMediathekBridge did not work reliably. I could not find one show for which the item list was not empty using the html screen scraping approach.

The proposed change uses the JSON-API of the WebApp. Although there is still room for improvement (feed title, better understanding of the API, more accurate mimic of the webapp's behavior, de-pagination …), it does work with this change.
[ARDMediathekBridge] Fixed phpcs issues: spaces between minus, array_key_last() not available in supported PHP version.
@f0086
Copy link
Contributor

f0086 commented Dec 21, 2021

Tested and worked smoothly.
It took me a moment to find the right path, so maybe adjust the title of the path option so it is clear which path is needed here (all without the https://www.ardmediathek.de/sendung/ prefix).

Besides that, its good to go.

@Mar-Koeh
Copy link
Contributor Author

path option so it is clear which path is needed here (all without the https://www.ardmediathek.de/sendung/ prefix).

That was the requirement of the previous version of the bridge. With this change, the whole URL, the ID with the slug (as before) and just the ID are accepted. The JSON-API that this version of the bridge switched to just needs the ID. Thus, a string extractor has been implemented that obtains the ID. Thus, it maintains compatibility to old inputs. All of the following works:

I guess I best change the label to “Show Link or ID”.

Indicate that now full URLs as well as just the ID are accepted.
@f0086
Copy link
Contributor

f0086 commented Dec 21, 2021

That's perfect! 👌

@Mar-Koeh
Copy link
Contributor Author

That's perfect! 👌

Thanks a lot, @f0086 I have pushed the change to the branch. Once the workflows are done with no problems, I hope for a merge. 😊 I made no changes to the code style and the used functions are the same, so I expect the checks to be successful.

bridges/ARDMediathekBridge.php Outdated Show resolved Hide resolved
bridges/ARDMediathekBridge.php Outdated Show resolved Hide resolved
@@ -4,32 +4,87 @@ class ARDMediathekBridge extends BridgeAbstract {
const URI = 'https://www.ardmediathek.de';
const DESCRIPTION = 'Feed of any series in the ARD-Mediathek, specified by its path';
const MAINTAINER = 'yue-dongchen';
Copy link
Contributor

Choose a reason for hiding this comment

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

90% of bridge code has been rewritten.
If you, @Mar-Koeh, are going to maintain this bridge, you can add your github name via comma.

Bridge maintainers are pinged in issues, when error happens.

Also question for @yue-dongchen, are still maintaining this bridge?

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't know of the API before. I'll stay there and watch out for new issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

90% of bridge code has been rewritten. If you, @Mar-Koeh, are going to maintain this bridge, you can add your github name via comma.

if @yue-dongchen is fine with it, I'd join maintaining this bridge.

according to @em92 returnServerError would never be called as the other function either works successfully or throws an exception.
As suggested by @em92 an empty required parameter `path `now causes an error message
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.

5 participants