Skip to content

Commit

Permalink
Fix: Video Player Changed
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkitpareek18 committed Oct 9, 2024
1 parent 69da661 commit f732788
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
10 changes: 5 additions & 5 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ function fetchAndShow() {
let imageAndInfo = "";

if (result.qid === "movie" && result.i) {
imageAndInfo = `<a onClick="setUrl(this); return setVideo(this);" url="imdb=${result.id}&type=movie&title=${result.l.replace(/ /g, "_")}" isWebSeries="false" title="${result.l}" class="links" IMDB="${result.id}" href="https://multiembed.mov/directstream.php?video_id=${result.id}" target="_blank">
imageAndInfo = `<a onClick="setUrl(this); return setVideo(this);" url="imdb=${result.id}&type=movie&title=${result.l.replace(/ /g, "_")}" isWebSeries="false" title="${result.l}" class="links" IMDB="${result.id}" href="https://www.2embed.cc/embed/${result.id}" target="_blank">
<img alt="${result.l}" src="${optimisedImageUrl(result.i.imageUrl)}">
<div class="info">
<h3>${result.l}</h3>
<p>${result.s}</p>
</div>
</a>`;
} else if (result.qid === "tvSeries" && result.i) {
imageAndInfo = `<a onClick="setUrl(this); return setVideo(this);" url="imdb=${result.id}&season=1&episode=1&title=${result.l.replace(/ /g, "_")}" IMDB="${result.id}" title="${result.l}" isWebSeries="true" class="links" href="https://multiembed.mov/directstream.php?video_id=${result.id}&s=1&e=1" target="_blank">
imageAndInfo = `<a onClick="setUrl(this); return setVideo(this);" url="imdb=${result.id}&season=1&episode=1&title=${result.l.replace(/ /g, "_")}" IMDB="${result.id}" title="${result.l}" isWebSeries="true" class="links" href="https://www.2embed.cc/embedtv/${result.id}&s=1&e=1" target="_blank">
<img alt="${result.l}" src="${optimisedImageUrl(result.i.imageUrl)}">
<div class="info">
<h3>${result.l}</h3>
Expand Down Expand Up @@ -88,7 +88,7 @@ function setAll(imdb, title, season, episode, type) {
a.setAttribute("title", title);
a.setAttribute("class", "links");
a.setAttribute("IMDB", imdb);
a.setAttribute("href", "https://multiembed.mov/directstream.php?video_id=" + imdb);
a.setAttribute("href", "https://www.2embed.cc/embed/" + imdb);
a.setAttribute("target", "_blank");
a.click();
} else if (imdb && title && episode && !type) {
Expand All @@ -103,7 +103,7 @@ function setAll(imdb, title, season, episode, type) {
a.setAttribute("IMDB", imdb);
a.setAttribute(
"href",
`https://multiembed.mov/directstream.php?video_id=${imdb}&s=${season}&e=${episode}`
`https://www.2embed.cc/embedtv/${imdb}&s=${season}&e=${episode}`
);
a.setAttribute("target", "_blank");
a.click();
Expand Down Expand Up @@ -337,7 +337,7 @@ function setVideo(element) {
minimumIntegerDigits: 2,
useGrouping: false,
});
episodesData += `<a class="episodes" title="${seasonsDataJSON.name + ": E" + formatedEpisodeNumber + ". " + episode.name}" cssidentification="s${seasonNumber}e${episodeNumber}" url="imdb=${imdbID}&season=${seasonNumber}&episode=${episodeNumber}&title=${seasonsDataJSON.name.replace(/ /g, "_") + "_E" + formatedEpisodeNumber + "_" + episode.name.replace(/ /g, "_")}" onClick="event.preventDefault();setVideo(this);setUrl(this); " href="https://multiembed.mov/directstream.php?video_id=${imdbID}&s=${seasonNumber}&e=${episodeNumber}">E${formatedEpisodeNumber}. ${episode.name}</a>`;
episodesData += `<a class="episodes" title="${seasonsDataJSON.name + ": E" + formatedEpisodeNumber + ". " + episode.name}" cssidentification="s${seasonNumber}e${episodeNumber}" url="imdb=${imdbID}&season=${seasonNumber}&episode=${episodeNumber}&title=${seasonsDataJSON.name.replace(/ /g, "_") + "_E" + formatedEpisodeNumber + "_" + episode.name.replace(/ /g, "_")}" onClick="event.preventDefault();setVideo(this);setUrl(this); " href="https://www.2embed.cc/embedtv/${imdbID}&s=${seasonNumber}&e=${episodeNumber}">E${formatedEpisodeNumber}. ${episode.name}</a>`;
}

episodeContainer.innerHTML = episodesData;
Expand Down
Loading

0 comments on commit f732788

Please sign in to comment.