Skip to content

Commit

Permalink
v10.0.4 Fix reels bug
Browse files Browse the repository at this point in the history
  • Loading branch information
saschaheim committed Aug 25, 2021
1 parent 8161120 commit 84673d8
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 21 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# <img style="float: left; vertical-align: bottom; " width="35" src="https://upload.wikimedia.org/wikipedia/commons/4/4c/Typescript_logo_2020.svg"> [instantgram] v10.0.3
![GitHub release](https://img.shields.io/badge/release-v10.0.3-green)
# <img style="float: left; vertical-align: bottom; " width="35" src="https://upload.wikimedia.org/wikipedia/commons/4/4c/Typescript_logo_2020.svg"> [instantgram] v10.0.4
![GitHub release](https://img.shields.io/badge/release-v10.0.4-green)

![badge](https://img.shields.io/badge/for-instagram-yellow.svg?style=flat-square)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/)
Expand Down Expand Up @@ -39,6 +39,7 @@ With this version we support all modern browsers that have ECMAScript 2015 (es6)
Read [CONTRIBUTING.md](CONTRIBUTING.md) for more information. :heart:

## Changelog
- v10.0.4 - [instangram] Fix reels not working.
- v10.0.3 - [instangram] Fix profile page downloading/compression calculation.
- v10.0.2 - [instangram] Complete rewrite of the Project to support Firefox again. \
By rewriting, we were also able to increase the speed noticeably. \
Expand Down
2 changes: 1 addition & 1 deletion dist/main.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lang/de-de/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lang/en-us/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lang/es-ar/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lang/pt-br/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "instantgram",
"version": "10.0.3",
"version": "10.0.4",
"description": "A bookmarklet for download photos in Instagram",
"author": "Matheus Falcão as of 4.0.0 Sascha Heim",
"homepage": "https://thinkbig-company.github.io/instantgram/",
Expand Down
2 changes: 1 addition & 1 deletion src/_langs/partials/button.html

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/helpers/getPath.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function getPath(url, defaults) {
var reUrlPath = /(?:\w+:)?\/\/[^\/]+([^?#]+)/;
var query = /(?:\w+:)?\/\/[^\/]+([^?#]+)([^\?]+)(\?.*)?/;
var urlParts = url.match(reUrlPath) || [url, defaults];

return urlParts.pop() + url.match(query).pop();
}
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { Program } from './App';
import { MediaScanner } from './modules/MediaScanner';
import { ProfilePageDownload } from './modules/ProfilePageDownload';
Expand Down Expand Up @@ -53,11 +52,12 @@ if (program.regexHostname.test(program.hostname)) {
console.log('profilePageDownload', profilePageDownload);
}

program.foundVideo = profilePageDownloadProgram.foundVideo;
program.foundImage = profilePageDownloadProgram.foundImage;
program.foundProfile = profilePageDownloadProgram.foundProfile;
program.foundVideo = profilePageDownloadProgram.foundVideo;
program.foundByModule = profilePageDownloadProgram.foundByModule;

if (profilePageDownload == false) {
if (profilePageDownload == false && program.foundProfile) {
new Modal({
heading: [
`<h5>[instantgram] <span style="float:right">v${profilePageDownloadProgram.VERSION}</span></h5>`
Expand Down
7 changes: 4 additions & 3 deletions src/modules/MediaScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { Program } from '../App';
import { Module } from './Module';
import { Modal } from '../components/Modal';
import getHighestResImg from '../helpers/getHighestResImg';
import isElementInViewport from '../helpers/isElementInViewport';
import getBlobVideoUrl from '../helpers/getBlobVideoUrl';
import getPath from '../helpers/getPath';
import getPreLoader from '../helpers/getPreLoader';
import isElementInViewport from '../helpers/isElementInViewport';
import localize from '../helpers/localize';

enum MediaType {
Expand Down Expand Up @@ -384,7 +385,7 @@ export class MediaScanner implements Module {

if (scrapedBlobVideoUrl) {
/* Fix error network error since mai 2021 cannot download */
let _newVideoUrl = scrapedBlobVideoUrl.replace(/^[^.]*/, 'https://scontent');
let _newVideoUrl = 'https://scontent.cdninstagram.com' + getPath(scrapedBlobVideoUrl, 'unknown');
window.open(_newVideoUrl);

callback(found, program);
Expand Down Expand Up @@ -413,7 +414,7 @@ export class MediaScanner implements Module {
program.foundByModule = this.getName();

/* Fix error network error since mai 2021 cannot download */
let _newVideoUrl = mediaLink.replace(/^[^.]*/, 'https://scontent');
let _newVideoUrl = 'https://scontent.cdninstagram.com' + getPath(mediaLink, 'unknown');
window.open(_newVideoUrl);

callback(found, program);
Expand Down
1 change: 1 addition & 0 deletions src/modules/ProfilePageDownload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ export class ProfilePageDownload implements Module {
this.displayIsPrivateModal();

program.foundProfile = false;
program.foundByModule = this.getName();

callback(false, program);
return;
Expand Down

0 comments on commit 84673d8

Please sign in to comment.