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

feat(P-Stream): Add presence #9254

Closed
wants to merge 11 commits into from

Conversation

moyaimoment
Copy link
Contributor

Description

Was unable to figure out the iframe/video current playtime.

Acknowledgements

Screenshots

Proof showing the creation/modification is working as expected

image

image

image

@Slowlife01
Copy link
Contributor

Slowlife01 commented Feb 7, 2025

You are spamming the API you need to cache it

And they don't seem to use iframe so this works
https://github.com/PreMiD/Presences/blob/eff597160d258c6f7f2609def29f54a694a5c131/websites/C/Cineby/presence.ts#L85-L91

@moyaimoment
Copy link
Contributor Author

You are spamming the API you need to cache it

Whoops.. What would be a good way to do this? 🤔

Signed-off-by: moyaimoment <[email protected]>
@moyaimoment
Copy link
Contributor Author

After taking a look at the YouTube, Jellyfin, etc API get I created a cache instead of accidently spamming the TDMB API (whoops).
Also thanks to Slowlife01 I was able to add timestamping.

Signed-off-by: moyaimoment <[email protected]>
Signed-off-by: moyaimoment <[email protected]>
headers: {
accept: "application/json",
Authorization:
"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhNTAwMDQ5ZjNlMDYxMDlmZTNlODI4OWIwNmNmNTY4NSIsInN1YiI6IjY1ZTEyNDAyMmQ1MzFhMDE4NWMwZjJmNSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.1J3EfnfmpJyZ4MV66eadk3h929zdeZfvjTO2JXhboWw",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a private api key?

Copy link
Contributor

Choose a reason for hiding this comment

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

The API is free doesn't really matter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a private api key?

It's the same the website itself uses lol. 🤷‍♂️

@theusaf theusaf linked an issue Feb 11, 2025 that may be closed by this pull request
2 tasks
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

ESLint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@moyaimoment
Copy link
Contributor Author

318 errors? 😭😭

Signed-off-by: moyaimoment <[email protected]>
Signed-off-by: moyaimoment <[email protected]>
@theusaf theusaf requested a review from Bas950 February 12, 2025 23:51
const video = document.querySelector('video')
if (video) {
if (!video.paused) {
[presenceData.startTimestamp, presenceData.endTimestamp] = presence.getTimestampsfromMedia(video)

Check failure

Code scanning / ESLint

Disallow using code marked as `@deprecated`

`getTimestampsfromMedia` is deprecated. since 2.7.5 - Use the standalone `getTimestampsFromMedia` function instead: import { getTimestampsFromMedia } from 'premid'
@moyaimoment
Copy link
Contributor Author

moyaimoment commented Feb 19, 2025

This can actually be closed because apparently P-Stream is the same as #9284. Will add the getting the cover for TV/movie for largeImageKey after current Pull is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

P-Stream | pstream.org
6 participants