promitheas

joined 2 years ago
[–] promitheas@programming.dev 2 points 3 months ago (3 children)

The datasheet just has this:

DC Power Pin for Primary Power Supply. This pin should be decoupled using a 0.1µF to 1.0µF capacitor. If not used, connect to ground.

But if it really is OK to use an electrolytic one given the polarity is correct, then thats still good. Ive been looking on online stores for 1uF ceramic capacitors and I couldnt find any.

[–] promitheas@programming.dev 4 points 4 months ago

Dont go period. Even before this situation I was actively opposed to it. What people seem to conveniently forget is that the US didn't suddenly become a fascistic empire overnight because of the election of one man. Its been like this, just less "in your face" about it. Most people only seem to care now because now there is a big negative effect on the USA itself as well as other western countries, but previously while it was some south-east asian, or middle-eastern, or south-american (you get the point) country most people conveniently turned a blind eye and just consumerismed.

[–] promitheas@programming.dev 3 points 4 months ago (1 children)

Ive been learning video editing with Shotcut recently. Its FOSS

[–] promitheas@programming.dev 6 points 4 months ago

Thanks, and yea that was my bad, shouldnt have phrased it like that in the context of this thread. I only just noticed after reading your comment. Hopefully its good for me, im excited for it :))

[–] promitheas@programming.dev 8 points 4 months ago (2 children)

As far as im aware (and please correct me if im wrong) that is true but the company is European based in the Netherlands, and given their dedication to paying and treating workers fairly I still think its a viable option for a non-US brand phone that is still competitive.

[–] promitheas@programming.dev 7 points 4 months ago (4 children)

Check out Fairphone! Its really promising on the hardware side of things. I ordered mine with /e/os a couple days ago

[–] promitheas@programming.dev 1 points 4 months ago

I dont. Theyve been fascists in disguise whether intentionally or by their own stupidity for decades, causing so much pain across the world. Its high time they felt that pain themselves, and ill be relishing every bit of suffering they have to endure. I just hope im alive long enough to see the empires fall

[–] promitheas@programming.dev 9 points 4 months ago (1 children)

I believe this is easily solved by considering why consumers care about origin so much in these times. Namely, to boycot US. So simply indicating on the product (e.g. with a us flag) whether any part of its production chain is US-based and hence will put money in US hands, is enough for consumers to make a choice about the product.

[–] promitheas@programming.dev 0 points 4 months ago

As a technology, crypto does (on paper) solve most problems with FIAT currencies. The problem is as always the people using it. Just like the article linked above, when you have mono/duopolies it can become a problem. In terms of crypto, when people treat(ed) it as regular currency and kept it stored in centralised locations, it makes it easy to take advantage of them.

Likewise, literacy about a technology starts off low. Just how in the early days of eshopping using a visa/mastercard there were probably many people getting scammed to input their card details in sites they shouldn't have, there are many people who dont know how to be safe while using crypto today.

Instead of being bitter to the tech because you or people you know got scammed by being careless with their money, see the positives of the tech and make steps to educate them so it doesnt happen again.

[–] promitheas@programming.dev 8 points 4 months ago (2 children)

Theres no way this is an actual tweet. Guys...?

[–] promitheas@programming.dev 3 points 5 months ago* (last edited 5 months ago) (1 children)

Oh, Im sorry. If I'm honest I completely forgot. Here it is:

You will need ffmpeg installed, and I did write it for Linux, so I'm not sure if there are differences for windows. Worst case you need to slightly modify it to work on windows.

#!/usr/bin/env python3

import requests
import os
import subprocess
from urllib.parse import urljoin
import sys

def download_video_chunks(base_url, output_file):
    """
    Downloads video chunks from the given base URL and merges them into a single file.

    :param base_url: The URL to the playlist or base directory containing the video chunks.
    :param output_file: The name of the output video file (e.g., "output.mp4").
    """
    try:
        # Get the playlist file (e.g., .m3u8 or .ts index file)
        print(f"Fetching playlist or video chunk URLs from: {base_url}", flush=True)
        response = requests.get(base_url, timeout=10)
        response.raise_for_status()
        
        # Parse the playlist to get the chunk URLs
        lines = response.text.splitlines()
        chunk_urls = [urljoin(base_url, line) for line in lines if line and not line.startswith("#")]

        if not chunk_urls:
            print("No video chunks found in the provided URL.", flush=True)
            return

        # Create a directory for storing chunks
        os.makedirs("video_chunks", exist_ok=True)

        # Download each chunk
        chunk_files = []
        for idx, chunk_url in enumerate(chunk_urls):
            chunk_file = os.path.join("video_chunks", f"chunk_{idx:04d}.ts")
            print(f"Downloading {chunk_url}...", flush=True)

            with requests.get(chunk_url, stream=True) as chunk_response:
                chunk_response.raise_for_status()
                with open(chunk_file, "wb") as f:
                    for chunk in chunk_response.iter_content(chunk_size=1024):
                        f.write(chunk)

            chunk_files.append(chunk_file)

        # Merge the chunks into a single file using ffmpeg
        print("Merging chunks...", flush=True)
        with open("file_list.txt", "w") as f:
            for chunk_file in chunk_files:
                f.write(f"file '{chunk_file}'\n")

        subprocess.run(["ffmpeg", "-f", "concat", "-safe", "0", "-i", "file_list.txt", "-c", "copy", output_file], check=True)

        print(f"Video saved as {output_file}", flush=True)

    except requests.exceptions.RequestException as e:
        print(f"An error occurred while downloading: {e}", flush=True)
    except subprocess.CalledProcessError as e:
        print(f"An error occurred while merging: {e}", flush=True)
    finally:
        # Clean up temporary files
        if os.path.exists("file_list.txt"):
            os.remove("file_list.txt")
        for chunk_file in chunk_files:
            os.remove(chunk_file)
        # if os.path.exists("video_chunks"):
            # os.rmdir("video_chunks")

if __name__ == "__main__":
    base_url = input("Enter the URL of the video playlist or base directory: ")
    output_file = input("Enter the output video file name (e.g., output.mp4): ")
    print(f"Starting download process for playlist: {base_url}", flush=True)
    download_video_chunks(base_url, output_file)

If you guys can recommend a fair and open pastebin alternative for me I will upload it there as well and edit this with the link

view more: ‹ prev next ›