Skip to content

Commit

Permalink
Merge branch 'release' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Jan 5, 2025
2 parents b815ed2 + 4d3d5b4 commit cc38038
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reactive-pepyatka",
"version": "1.136.3",
"version": "1.136.4",
"description": "",
"main": "index.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function Footer({ short }) {
return (
<footer className="footer">
<p role="navigation">
&copy; FreeFeed 1.136.3-beta (Jan 5, 2025)
&copy; FreeFeed 1.136.4-beta (Jan 5, 2025)
<br />
<Link to="/about">About</Link>
{' | '}
Expand Down
24 changes: 17 additions & 7 deletions src/components/link-preview/video.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,22 +391,32 @@ async function getGiphyVideoInfo(url) {
}

async function getAparatVideoInfo(url) {
const oembedUrl = `https://www.aparat.com/oembed?url=${encodeURIComponent(url)}`;
const data = await cachedFetch(`${apiPrefix}/cors-proxy?url=${encodeURIComponent(oembedUrl)}`);
const id = getVideoId(url);
const apiUrl = `https://www.aparat.com/etc/api/video/videohash/${id}`;
const data = await cachedFetch(`${apiPrefix}/cors-proxy?url=${encodeURIComponent(apiUrl)}`);

if (data.error) {
return { error: data.error };
}

if (!('title' in data)) {
if (!('video' in data)) {
return { error: data.error ? data.error : 'error loading data' };
}

const { video } = data;

let ratio = 9 / 16;
try {
const img = await loadImage(video.big_poster);
ratio = img.height / img.width;
} catch {
// ignore
}
return {
byline: `${data.title} by ${data.author_name}`,
aspectRatio: aspectRatio.set(url, data.height / data.width),
previewURL: data.thumbnail_url,
playerURL: `https://www.aparat.com/video/video/embed/videohash/${getVideoId(url)}/vt/frame`,
byline: `${video.title} by ${video.sender_name}`,
aspectRatio: aspectRatio.set(url, ratio),
previewURL: video.big_poster,
playerURL: video.frame,
};
}

Expand Down

0 comments on commit cc38038

Please sign in to comment.