Open ten0s opened 11 months ago
Afternoon.
The same problem occurred with version 0.2.2 on Ubuntu 22.04
Didn't fix yet?
version 0.2.2 works in Docker. Use python:3.11.5 image
This is how I started the script using Docker on Ubuntu 22.04.
Create ~/Downloads/kinescope-dl
directory and put the script there, so the path to the script will be ~/Downloads/kinescope-dl/kinescope-dl
. Also create subdirectory ~/Downloads/kinescope-dl/output
for output files:
mkdir -p ~/Downloads/kinescope-dl/output
Create ~/Downloads/kinescope-dl/Dockerfile
with the following contents:
FROM python:3.11.5
WORKDIR /usr/local/bin
COPY kinescope-dl .
RUN apt-get -y update && apt-get -y upgrade && apt-get install -y --no-install-recommends ffmpeg
Build docker image:
cd ~/Downloads/kinescope-dl && docker build -t kinescope-dl/kinescope-dl:1.0 .
Run the following command to download a video:
docker run -it --rm --name kinescope-dl -v "$PWD/output":/usr/local/bin/output kinescope-dl/kinescope-dl:1.0 kinescope-dl --best-quality --referer https://referer.io https://kinescope.io/video-id ./output/video.mp4
where
https://referer.io
is the site having access to kinescope video;video-id
is kinescope video identifier.P.S. In order to automate bulk videos download I wrote the following simple Node.js script download.js
located in the same directory ~/Downloads/kinescope-dl
.
const path = require('path');
const fs = require('fs');
const readline = require('readline');
const { spawn } = require('child_process');
const outputDirectoryName = 'output';
const outputDirectoryPath = path.resolve(__dirname, outputDirectoryName);
const referer = 'https://referer.io';
async function parseSourceFile() {
const fileStream = fs.createReadStream('source.txt');
const rl = readline.createInterface({
input: fileStream,
crlfDelay: Infinity
});
const sourceItems = [];
for await (let line of rl) {
line = line.trim();
if (line.startsWith('#')) {
continue;
}
const items = line.split(' ');
if (items.length !== 2) {
continue;
}
const [url, name] = items;
sourceItems.push({ url, name });
}
return sourceItems;
}
async function processFile(url, name) {
const p = spawn('docker', [
'run',
'-it',
'--rm',
'--name',
'kinescope-dl',
'-v',
`${outputDirectoryPath}:/usr/local/bin/output`,
'kinescope-dl/kinescope-dl:1.0',
'kinescope-dl',
'--best-quality',
'--referer',
referer,
url,
`./${outputDirectoryName}/${name}`
], {
windowsHide: true,
stdio: [
// Standard: stdin, stdout, stderr
'inherit',
'inherit',
'inherit'
]
});
return new Promise((resolve, reject) => {
p.on('error', reject);
p.on('close', resolve);
});
}
(async () => {
const items = await parseSourceFile();
for (let i = 0; i < items.length; i += 1) {
const { url, name } = items[i];
const outputFileName = `${name}.mp4`;
const outputFilePath = `${outputDirectoryPath}/${outputFileName}`;
try {
console.log(`Processing ${url} (${i + 1} of ${items.length})...`);
await processFile(url, outputFileName);
console.log(`File "${outputFilePath}" has been saved`);
} catch (e) {
console.error(e);
} finally {
console.log();
}
}
})();
Create ~/Downloads/kinescope-dl/source.txt
file with kinescope videos URLs and desired output file names like this:
https://kinescope.io/c1675bcd-5856-4971-b174-bb5afa9e3120 video-1
https://kinescope.io/d5155728-60a2-4b74-9cd2-077d61066b46 video-2
https://kinescope.io/4fe46d1a-430f-40dc-b7c5-11e87e7bc571 video-3
https://kinescope.io/c6c9d44a-e57f-4f5b-82e7-dcada3a9b3de video-4
https://kinescope.io/49722314-4d63-44cf-98b9-ebfb6039f705 video-5
Also modify:
const referer = 'https://referer.io';
and run the script as follows:
node ./download.js
As the result, there will be the following files in output
directory:
video-1.mp4
video-2.mp4
video-3.mp4
video-4.mp4
video-5.mp4
Just wanted to let you know that I tried running the Linux version v0.2.2 got the error below:
I have the below configuration that is still pretty fresh:
It seems to me that you've built the release on a newer distribution like Ubuntu 23.04. I would suggest you to build the next Linux releases on an older distribution like Ubuntu 20.04 or oven 16.04 to have better coverage. Docker would work great here.
Anyway, thanks for the project!