Skip to content

Commit

Permalink
fix(mixdrop): positive look-behind issue, iOS/Expo
Browse files Browse the repository at this point in the history
iOS client-side bug on the web and/or Expo: causes issues with this extractor in the use cases described. This is due to an old spec. being supported in the case of iOS, and I am unsure in the case of Expo.
  • Loading branch information
aidanjuma committed Dec 17, 2022
1 parent c488e0d commit 4c164ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/extractors/mixdrop.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/extractors/mixdrop.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/extractors/mixdrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MixDrop extends VideoExtractor {

const match = load(data)
.html()
.match(/(?<=p}\().*(?<=wurl).*\}/g);
.match(/p}(.+?)wurl.+?}/g);

if (!match) {
throw new Error('Video not found.');
Expand All @@ -22,7 +22,8 @@ class MixDrop extends VideoExtractor {
const formated = this.format(p, a, c, k, e, JSON.parse(d));

const [poster, source] = formated
.match(/(?<=poster'=").+?(?=")|(?<=wurl=").+?(?=")/g)
.match(/poster'="([^"]+)"|wurl="([^"]+)"/g)
.map((x: string) => x.split(`="`)[1].replace(/"/g, ''))
.map((x: string) => (x.startsWith('http') ? x : `https:${x}`));

this.sources.push({
Expand Down

0 comments on commit 4c164ee

Please sign in to comment.