cross-posted from: https://discuss.tchncs.de/post/22423685

EDIT: For those who are too lazy to click the link, this is what it says

Hello,

Sad news for everyone. YouTube/Google has patched the latest workaround that we had in order to restore the video playback functionality.

Right now we have no other solutions/fixes. You may be able to get Invidious working on residential IP addresses (like at home) but on datacenter IP addresses Invidious won’t work anymore.

If you are interested to install Invidious at home, we remind you that we have a guide for that here: https://docs.invidious.io/installation/..

This is not the death of this project. We will still try to find new solutions, but this might take time, months probably.

I have updated the public instance list in order to reflect on the working public instances: https://instances.invidious.io. Please don’t abuse them since the number is really low.

Feel free to discuss this politely on Matrix or IRC.

  • @Soup@lemmy.cafe
    link
    fedilink
    English
    27
    edit-2
    9 months ago

    People can always just stop using YouTube. It’s getting laughable the level of Stockholm syndrome-like addiction people have for that shit service.

    • @jol@discuss.tchncs.de
      link
      fedilink
      English
      179 months ago

      I pay for Nebula and, although there’s a lot to watch there, skimming through the boring stuff is horrible.

      • @Soup@lemmy.cafe
        link
        fedilink
        English
        59 months ago

        It’s good to see alternatives. I am not at the point where I need to see online videos badly enough that I’d pay for it- but it’s good to know that it exists.

      • @sugar_in_your_tea@sh.itjust.works
        link
        fedilink
        English
        59 months ago

        Same. I mostly watch a handful of channels:

        • various TLDR channels
        • Morning Brew - not a fan of the hosts, so I’ll catch maybe one/week
        • LegalEagle - anything not about celebs
        • the Friday Checkout
        • NotJustBikes and other city infra-related channels - they don’t post often though
        • RealLifeLore
        • Wendover/HalfAsInteresting - the host annoys me a bit, but the content is usually pretty good

        There’s a ton of nonsense there that I don’t like, but now that I found a set of channels I do like, I mostly just look in the “library” tab so I don’t have to see the other crap.

        • @jol@discuss.tchncs.de
          link
          fedilink
          English
          29 months ago

          I also hate the UI tbh. I want the front page to be my subscriptions. Instead you get a weird horizontal scrolling panel on a secondary tab. I wish I could get an inbox, RSS style, so I could either watch them or skip/mark as watched.

          Nebula also suffers from the homepage being cluttered with old videos that are no longer relevant. For example I don’t care to watch news and tech videos from 2022.

        • @YetiMindtrick@lemmy.world
          link
          fedilink
          English
          49 months ago

          Knowing better and Philosophy Tube are both rather good as well. I do miss Casual Criminalist from YouTube, otherwise Nebula has my bases covered.

          • @jol@discuss.tchncs.de
            link
            fedilink
            English
            19 months ago

            I think it’s a shame that CGP Grey and Philip from Kurzgesagt both bailed early on. I never quite got why, but I guess Nebula for them was just canibalizing their lucrative youtube/patreon business.

    • @TheDarksteel94@sopuli.xyz
      link
      fedilink
      English
      189 months ago

      The problem is, there’s just no (good) direct competition. The audience will follow creators once enough of them switch to the same alternative platform. But as long as there’s no platform with a comparable amount of money behind it, most people will continue to use Youtube.

      • @sugar_in_your_tea@sh.itjust.works
        link
        fedilink
        English
        8
        edit-2
        9 months ago

        Eh, there are some competitors:

        • Nebula - costs $5/month; can get a discount if you find a creator’s discount code (I used NotJustBikes, can check out LegalEagle, HalfAsinteresting, or any of the others if you want; I got 50% off a year sub)
        • Odyssee - pretty much the OG alternative to YT - I follow a few there
        • Rumble - much better funded, but caters to conservatives and far-right, but there are some more moderate videos there (I like Glenn Greenwald, except for anything related to Russia); I think it’s funny that it has been blocked by some countries for allowing pro-Russian content, while also being blocked by Russia (this year) for not removing content

        I sub to some channels from each (as well as Twitch and YT) though Grayjay, which seems to work pretty well. I’d say about 50% of my video watch time is on YouTube, 15-20% on Odyssee, 20-30% on Nebula, and a little on Rumble. I try to watch Nebula videos on the Nebula app so creators get credited with watch time, but I honestly prefer Grayjay.

        I’ve been trying to cut down on how much I watch anyway, so hopefully I’ll be able to slowly eliminate YT from my life.

        • Daemon Silverstein
          link
          fedilink
          English
          39 months ago

          Rumble - […] I think it’s funny that it has been blocked by some countries

          Rumble is blocked here in Brazil, not because Brazil blocked it (although there was once a strife between Rumble and Brazilian Supreme Court due to a half dozen far-right influencers) , but because Rumble themselves blocked us.

        • @TheDarksteel94@sopuli.xyz
          link
          fedilink
          English
          19 months ago

          I know about Nebula, but you have to admit, the barrier to entrance is a lot higher for most people because of the subscription fee, so it’s not necessarily a direct comparison. Some of my favourite content creators are on there.

          Didn’t know about Odysee. As far as I can see, that platform uses crypto for payments, which could also act as a deterrent to some people.

          As for Rumble: Personally, I wouldn’t touch anything related to JD Vance with a ten foot pole (he’s a pretty big investor). And one of their biggest channels seems to be by Andrew Tate (ew). To be fair, I couldn’t tell you for sure that Youtube doesn’t take money from any of them in some form. But they seem to be more of an equal opportunity offender lol.

          • @sugar_in_your_tea@sh.itjust.works
            link
            fedilink
            English
            29 months ago

            As far as I can see, that platform uses crypto for payments, which could also act as a deterrent to some people.

            I’m confused, what I’m hearing is:

            • YouTube - don’t want because of ads and ownership by Google
            • Nebula - don’t want because of required subscription
            • Odysee - don’t want because of optional crypto payments
            • Rumble - undesirables use/invest in the platform?
            • PeerTube (not mentioned) - not enough content

            That seems unreasonable to me. All three of those alternatives have no ads and have content that you would probably enjoy. You don’t need to use crypto to use Odysee. You don’t need to watch Andrew Tate or support JD Vance to use Rumble. You do need to pay for Nebula, but you can pay for a single month if you just want to try it out.

            But at the end of the day, these alternatives need to get paid to survive. None of them are perfect, which is a big part of why I use Grayjay, which lets me sub to creators from all of them without having to see those services’ front pages. I pay for Nebula and I donate to creators I like at Odysee outside the built-in crypto system. I don’t like JD Vance, but I also don’t particularly care if we invests in Rumble, that really doesn’t affect me in any way. My goal is to reduce my YT use, and I’m not going to get there by continually moving the goalposts, so I decided to just pull the trigger and try them all out, and they’re fine.

            • @TheDarksteel94@sopuli.xyz
              link
              fedilink
              English
              19 months ago

              Oh, please don’t misunderstand: I personally don’t really care about leaving Youtube myself, but it’s good to have alternatives/competition. And as I said, there’s no direct competition to Youtube, which does everything they do. Low barrier to entry, a huge amount of money behind it, a self contained eco system with decent tools, barely any political affiliation (afaik), etc.

              So, I was more talking about why the majority of people won’t leave for other platforms.

              Pretty much everything Youtube does is driven by making the platform profitable. Which, ironically, makes me trust them more with certain things. Not a huge fan of their parent company tho.

      • @Soup@lemmy.cafe
        link
        fedilink
        English
        3
        edit-2
        9 months ago

        There doesn’t need to be direct competition. Just stop watching YouTube. If someone cannot do that- they have an addiction, and ads are not their biggest problem.

    • @xthexder@l.sw0.com
      link
      fedilink
      English
      229 months ago

      I don’t really think Stockholm syndrome applies here. I don’t watch YouTube out of some irrational bond with the platform. I watch YouTube because it’s literally the only place the creators I watch upload. I would absolutely follow the creators I watch to whatever platform the content is available on. Until then, I’m stuck with YouTube and ad blocking extensions.

    • @LifeOfChance@lemmy.world
      link
      fedilink
      English
      309 months ago

      As someone who does a lot of DIY what are my options? I can’t learn from reading and have nobody to show me how in person. Other platforms are so incredibly limited I can’t ever find any content helping me learn something. What other platform is seeking to ACTUALLY compete with YouTube by offering fair compensation and exposure to the masses? It’s so incredibly expensive to try that nobody is.

    • e$tGyr#J2pqM8v
      link
      fedilink
      English
      39 months ago

      That’s a fair point. There’s a million things you could do, and watching videos on YT is just one of them. Watching videos online has become a large part of peoples lives. Surely it has a lot to offer, but we should probably not forget it also replaces a lot of things, things we would spent are time on otherwise, if we didn’t have YT as an easy time-drain, and those other things are presumably equally rewarding or more so.

  • @zlatiah@lemmy.world
    link
    fedilink
    English
    53
    edit-2
    9 months ago

    The elites don’t want you to know but “[y]ou may be able to get Invidious working on residential IP addresses (like at home)”

    Following their guide gives a local Invidious client, don’t forget to 1) copy their production compose file instead of using the one on git and 2) change “hmac_key”… from my experience setting up cron (crontab -e) to restart the docker container once per day keeps the Invidious docker healthy


    Edit: here are some alternatives for popular Google services. Not in anyway related to the above (smirk

    • Google itself: SearXNG (try searx.be first), one of the easiest services to self-host
    • Gmail/calendar: a lot of people seem to swear by one of Proton Mail, Tutanota or Mailbox.org. Self-hosting is possible but challenging
    • Google Drive: You mean Nextcloud?
    • Google maps: Organic Maps is actually getting pretty good now
    • Google Chrome: at the very least there is Chromium… obviously there is Firefox and Firefox forks (such as Librewolf), as well as other smaller browsers
    • Google Play: F-Droid hosts a lot of FOSS stuff, and there are alternative ways to access Play (such as Aurora Store)
    • Android: a bit more difficult… but there is LineageOS, GrapheneOS, and similar stuff
    • @ShepherdPie@midwest.social
      link
      fedilink
      English
      259 months ago

      If you do this, I would be fully prepared to lose access to all your Google services along with anyone else who may use Google services on the same IP. Gmail, Play store, Chrome, etc, etc can easily be wiped out with a ban from Google and this can seriously fuck people’s day up if they’ve used Gmail and have 2FA setup on any external account.

      • @r0ertel@lemmy.world
        link
        fedilink
        English
        59 months ago

        Cory wrote about this in his essay, "Unpersoned". I’ve been using gmail as a spam catcher for all the sleazy sites you need to register with, but didn’t realize how I’ve made a trap for myself when, for example, my prescriptions need 2 factor authorization via my gmail. This is going to be a hard one to detangle.

      • @zlatiah@lemmy.world
        link
        fedilink
        English
        99 months ago

        I guess I forgot to take that into consideration… I’m not worried about Google banning my IP since I essentially don’t use any Google services at all and my home IP is hidden behind a wireguard tunnel, but yes that is a valid concern

        But I mean someone can just spin it up on their home network so… No way 192.168.0.1:3000 can get someone into trouble right

        • @curry@programming.dev
          link
          fedilink
          English
          59 months ago

          Like any other web services, Google can see the public ip your personal invidious instance is using to access youtube servers. The local 192.168.x.x ip are for internal access.

  • @firepenny@lemmy.world
    link
    fedilink
    English
    7
    edit-2
    9 months ago

    So if Google can ban our IP if caught using this, could you not use some type of dynamic IP mechanism every time they ban the IP?

  • krdo
    link
    fedilink
    English
    159 months ago

    For Android users, I highly recommend NewPipe as a YouTube client

  • @sga@lemmy.world
    link
    fedilink
    English
    259 months ago

    For those who are want something similar to invidious, you can try youtube-local (not my project, I am just a user). It is a minimal python youtube client, and functions similar to other frontends, but runs locally. You lose some amount of privacy (youtube still has a general idea of who is watching with IPs), but it is not very exact, and there is an option to use tor to get the content. You can also enable sponsorblock, or hide yt-shorts.

  • Read Bio
    link
    fedilink
    English
    289 months ago

    newpiped and freetube will continue to work but piped is also blocked as well

  • capital
    link
    fedilink
    English
    159 months ago

    Self hosted option is a docker image. Probably not difficult to set up.

  • @IcePee@lemmy.beru.co
    link
    fedilink
    English
    69 months ago

    I wonder if some kind of mesh might work. Maybe like a secret Santa type deal. By that I mean everyone who connects, gets a randomised, anonymous partner or partners. Everyone in the swarm streams for each other.

  • @starman@programming.dev
    link
    fedilink
    English
    99 months ago

    Didn’t Odysee recently removed ads? Anyway, I think I’ll start watching videos on Odysee and peertube, via RSS feeds. At least from youtubers that upload there.

  • @flop_leash_973@lemmy.world
    link
    fedilink
    English
    87
    edit-2
    9 months ago

    YouTube will not change until people stop using it. And people do not want to put up with the inconvenience of not having a YouTube type service again for the amount of time it would take for YouTube to change or a viable competitor to take their place, it really is that simple.

    Are YouTube and Google terrible? For sure, but it only got this way because the only backstop to holding them accountable, the consumer, has proven that they will choose putting up with shitty products and services in the name of convenience 9 times out of 10.

    Same reasons that ad tiers are gaining a foothold in streaming services like Netflix. The consumer has shown they are fine with it.

    • Socialist Mormon Satanist
      link
      fedilink
      English
      289 months ago

      Same reasons that ad tiers are gaining a foothold in streaming services like Netflix. The consumer has shown they are fine with it.

      Yep, I remember when Netlfix first put it out there that they would start with the ads, and everyone on reddit was like, “Canceling my Netflix right now!!”

      Netflix is doing just fine without the 5 redditors who actually did cancel it. lmao

      • @A_Random_Idiot@lemmy.world
        link
        fedilink
        English
        209 months ago

        the problem is so many people are willing to say they’ll take a stand.

        but when the time comes, the mindnumbingly overwhelming majority suck it up, because they must have their precious shiny and can not suffer even the mildest of inconvenience.

        Its my biggest gripe in gaming, but its a enormous gripe just in general, with everything. because it doesnt matter if you are talking about appliances, creative software, video games, streaming services, stores, etc.

        • @D_Air1@lemmy.ml
          link
          fedilink
          English
          29 months ago

          To summarize what I was telling another person. The number of people who care are far outnumbered by the number of people who don’t. It doesn’t matter if you or I or all 10,000 (just a random number for the sake of argument) of the people subscribed to a sub like this were to cancel when r/justworks or r/normie (made up subreddits for the sake of argument) has 100,000,000 who don’t give a damn about computers, privacy, or anything else beyond the service working or not.

          • SSTF
            link
            fedilink
            English
            39 months ago

            I agree. Tech communities have a habit of drastically over estimating how much everyone else cares about the details of tech.

            Even something as simple as PC gaming scares off a lot of people because of the perception that you need to be some kind of tech wizard in order to cobble everything together to make a game run. Actual cobbling together of software to pirate (no matter how simple it seems to people in the know) is just a bunch of technobabble.

            • @D_Air1@lemmy.ml
              link
              fedilink
              English
              19 months ago

              I have people whom I still need to explain copy and paste to on a regular basis. Trust me, I understand.

              • @dan@upvote.au
                link
                fedilink
                English
                1
                edit-2
                9 months ago

                I’m a millennial and sometimes I feel like we’re the only generation that learnt how to use computers properly. Boomers / Gen X often aren’t great with computers, and neither are Gen Z / Alpha since they use phones and tablets far more. There’s outliers of course.

        • KillingTimeItself
          link
          fedilink
          English
          09 months ago

          this is the primary reason i advocate for more piracy, and even legal protections for piracy, in some capacity.

          It’s one of the few spaces i consider to be a “truly free market” when it comes to economics.

          • @A_Random_Idiot@lemmy.world
            link
            fedilink
            English
            1
            edit-2
            9 months ago

            I’m more and more inclined towards the idea of piracy myself as time goes on and media continues to shave itself down into more and more ridiculous, unrelated shards, that you have to subscribe to just to be able to SEE if they have what you want.

            I don’t actively do it actively since I dont really know where to begin, and things I have found have been to sketch for me, or requiring memberships or even payments to join.

            • KillingTimeItself
              link
              fedilink
              English
              19 months ago

              if you’re looking for the babies first torrenting introduction, dbzer0 has a pretty comprehensive guide on it.

              Might be worth looking into i2p as well, if you don’t want to spend any money on it at least. Usenets and closed trackers are a weird one, usually based on memberships, but with good quality control of members and content so.

              there’s also the *arr stack but im sure there’s a write of that one up on github or something.

              • @A_Random_Idiot@lemmy.world
                link
                fedilink
                English
                19 months ago

                I poked around dbzer0 and found a few streaming sites, Nothing which carried anything i was particularly interested in.

                Navigating this stuff without my ISP getting pissy is another hurdle, too.

                It was much easier 20+ years ago when you just searched KaZaA or Limewire, or back when piratebay was the site (and before it got drowned in virus traps)

                • KillingTimeItself
                  link
                  fedilink
                  English
                  19 months ago

                  https://lemmy.dbzer0.com/c/piracy

                  check out the megathread for generic info and recommendations.

                  https://lemmy.dbzer0.com/post/30062 specific thread for i2p, there’s plenty more information out there, you can also ask me about a few things as well.

                  the TL;DR for doing it without ur isp bonking u is to use a VPN, or a seedbox, which are options. Though you’ll ideally want to use anonymous payment services like monero instead of something else, if you really want to be secure.

                  from what i understand, private trackers are generally fine and secure, aside from the fact that ur isp might not like the traffic, but that’s a fault of the ISP, not the law. torrenting is perfectly legal. Though using a VPN is probably still recommended anyway.

                  navigating malicious software is kind of hit or miss now, but it’s more likely you’ll find them on bigger reaching platforms, and in actual software, rather than like, mp3s or movies. That’s just basic opsec though. (again private trackers are beneficial for this reason, they have better QA and vetting)

      • @D_Air1@lemmy.ml
        link
        fedilink
        English
        49 months ago

        I know you weren’t using the number 5 as a hard example, but a thing that people still don’t seem to realize is that the people in threads like this are the people that actually care. Even if the few thousand redditors who subscribe to a subreddit where they discussed that topic were to all (and I mean 100% of them) cancel there subscriptions. That is still only a drop in the bucket for Netflix. Losing a few thousand subscribers is still nothing if they made more money with the addition of ads.

        • SSTF
          link
          fedilink
          English
          59 months ago

          It is interesting to me that the chorus always talking about “switching” to piracy after every incident is also intimately familiar with piracy already. Almost as if it’s just people who already pirate talking to each other about how hard they are going to pirate. Meanwhile general audiences don’t care.

          • KillingTimeItself
            link
            fedilink
            English
            19 months ago

            Almost as if it’s just people who already pirate talking to each other about how hard they are going to pirate. Meanwhile general audiences don’t care.

            this isn’t quite true, we have seen an uptick in piracy over the last few years from the streaming service hyper diversion thats been happening for some time now.

            It’s probably not a lot of people, but it is still happening.

        • @dan@upvote.au
          link
          fedilink
          English
          2
          edit-2
          9 months ago

          Losing a few thousand subscribers is still nothing if they made more money with the addition of ads.

          It’s the same with increasing the price of a service. Usually, the extra revenue from the price increase is far greater than the revenue loss from people that unsubscribe. If a business has a choice between a large number of customers with a small amount of profit per customer, and a small number of customers with a larger amount of profit per customer, they’ll always pick the latter. Fewer customers reduces other costs, for example less support load, less bandwidth usage, etc.

    • @ironsoap@lemmy.one
      link
      fedilink
      English
      119 months ago

      While I agree, I have a hard time seeing how people will stop using it until the field changes. Maybe in 10 years it will the the MySpace of the sitcom era, but right now it’s still growing. That growth is giving it carte blanche to manipulate the users as it sees fit. Regulation might impact it, but it’s still a bit of a Goliath.

      • Compared to 2023, YouTube’s user base has grown by 20 million this year, representing a 0.74% increase. From Global media insights

      Also the active user base is 2.7 billion people in 2024 from the same source above.

      The alternatives are out there, but just not in the same league.

      • @helenslunch@feddit.nl
        link
        fedilink
        English
        109 months ago

        Regulation might impact it

        I’m having a hard time seeing any bill get passed that supports the rights of users to watch videos without the ads that support the creators and the platform that they’re watching.

        • @TheEighthDoctor@lemmy.world
          link
          fedilink
          English
          1
          edit-2
          9 months ago

          I’m having a hard time seeing any bill get passed that supports the rights of users to watch videos without the ads that support the creators and the platform that they’re watching.

          We should reach a compromise of having skippable ads in the beginning only, for example. In other pages it could be that ads cannot be bigger than 10% of the content being delivered on the page.

          It’s not always all or nothing, good regulation listens to both sides and reaches a compromise in the middle, but good regulation is getting harder and harder to come by.

        • @ironsoap@lemmy.one
          link
          fedilink
          English
          39 months ago

          I don’t think this requires an act of congress. I think you might see more consumer advocation on the part of FTC (although it doesn’t currently regulate online broadcast), or potentially the CFPB.

          Admittedly it’s more likely to see the EU do some regulations, but it all depends on the election.

          • @Petter1@lemm.ee
            link
            fedilink
            English
            29 months ago

            I think it needs regulation, the whole streaming industry needs to be regulated! It can’t be that the competition is made using exclusive content and you have to live with privacy infringement tech to consume cultural art legally.

            In my opinion, in a capitalist system, the market competition should be about delivering the content the best way, not about what content they deliver.

            Right now, they can made the delivery as shitty as they want, because what takes them apart from competition is the exclusive content, not the tech.

            • @ironsoap@lemmy.one
              link
              fedilink
              English
              29 months ago

              Agreed, now the fun part of coming up with a legal basis to do so and convincing regulators.

              • @Petter1@lemm.ee
                link
                fedilink
                English
                29 months ago

                I think in the EU one could achieve something like this a la appstore opening rule, where streaming services are demanded to give other streaming services access to the library, lime some sort of roaming 🤔

                Or you split the distribution from the company producing stuff

                So many possibilities 😂

                Luckily I am in a pirate friendly country 🏴‍☠️

        • KillingTimeItself
          link
          fedilink
          English
          29 months ago

          regulations for ad quality, and privacy, are almost certainly what they mean by that.

    • @Petter1@lemm.ee
      link
      fedilink
      English
      199 months ago

      Time to pirate YT content and upload to usenet to be automatically downloaded using sonarr

      • @PM_Your_Nudes_Please@lemmy.world
        link
        fedilink
        English
        79 months ago

        Honestly, it would probably be easier to just build a *arr program specifically for downloading YouTube videos directly. Tie it into the rest of the *arr suite, with naming conventions for Plex/Jellyfin.

        • @Petter1@lemm.ee
          link
          fedilink
          English
          19 months ago

          I would install that, but I fear scraping youtube will be a arms race, soon, similar to other streaming services

      • @Gutless2615@ttrpg.network
        link
        fedilink
        English
        89 months ago

        Yes but literally throwing together a script to download the days subscription videos to a jellyfin media drive would be stupidly simple.

        • @irreticent@lemmy.world
          link
          fedilink
          English
          39 months ago

          “Stupidly simple” might be overselling it when it comes to the masses adopting it. Not everyone is adept at “throwing together a script.”

          That being said, I’m all for helping the masses adapt.

          • @Gutless2615@ttrpg.network
            link
            fedilink
            English
            49 months ago

            “Give me a Python script using yt-dlp that I can run on a cronjob that will download the videos from any of my subscribed channels since the last time the script was run”

            You can use the following Python script to download videos from your subscribed channels since the last run. This script uses yt-dlp and stores the last download timestamp to track new videos.

            First, ensure you have yt-dlp installed:

            pip install yt-dlp
            

            Then, create a script called download_videos.py:

            import os
            import json
            import subprocess
            from datetime import datetime
            
            # Configuration
            last_run_file = 'last_run.json'
            download_directory = 'downloads'
            
            # Ensure the download directory exists
            os.makedirs(download_directory, exist_ok=True)
            
            # Load the last run time
            if os.path.exists(last_run_file):
                with open(last_run_file, 'r') as f:
                    last_run = json.load(f)['last_run']
            else:
                last_run = datetime.now().isoformat()
            
            # Update the last run time to now
            current_run = datetime.now().isoformat()
            
            # Command to get videos from subscribed channels since the last run
            command = [
                'yt-dlp',
                '--download-archive', 'archive.txt',
                '--output', f'{download_directory}/%(title)s.%(ext)s',
                '--date-after', last_run,
                '--no-post-overwrites',
                '--merge-output-format', 'mp4',
                'https://www.youtube.com/channel/CHANNEL_ID',  # Replace with your channel URL
            ]
            
            # Run the command
            subprocess.run(command)
            
            # Save the current run time
            with open(last_run_file, 'w') as f:
                json.dump({'last_run': current_run}, f)
            
            print("Download complete. Next run will check for videos since:", current_run)
            

            Setting Up the Cron Job

            1. Make the script executable:

              chmod +x download_videos.py
              
            2. Open your crontab:

              crontab -e
              
            3. Add a line to run the script at your desired interval (e.g., daily at 2 AM):

              0 2 * * * /path/to/python /path/to/download_videos.py
              

            Notes

            • Replace CHANNEL_ID in the script with your actual channel IDs or use a playlist URL if preferred.
            • The archive.txt file keeps track of already downloaded videos to avoid duplicates.
            • Adjust the paths to Python and your script as needed.
            • @webghost0101@sopuli.xyz
              link
              fedilink
              English
              2
              edit-2
              9 months ago

              Another example, which i can personally verify has been working fine for months. It works a bit different to the above, it downloads the latests 2* vids that are not already downloaded and runs once every hour with cron. I also attempted to filter out live vids and shorts.

              Channels i am “subscribed” too are stored in a single text file, it also uses the avc1 codec because i found p9 and p10 had issues with the jellyfin client on my tv.

              looks like this, i added categories but i don’t actually use them in the script besides putting them in a variable, lol. Vid-limit is how many of the latests vids it should look at to download. The original reason i implemented that is so i could selectively download a bulk of latests vids if i wanted to.

              Cat=Science
              Name=Vertitasium
              VidLimit=2
              URL=https://www.youtube.com/channel/UCHnyfMqiRRG1u-2MsSQLbXA
              
              Cat=Minecraft
              Name=EthosLab
              VidLimit=2
              URL=https://www.youtube.com/channel/UCFKDEp9si4RmHFWJW1vYsMA
              
              #!/bin/bash
              
              
              # Define the directory to store channel lists and scripts
              script_dir="/.../YTDL"
              
              # Define the base directory to store downloaded videos
              base_download_dir="/.../youtubevids"
              
              # Change to the script directory
              cd "$script_dir"
              
              # Parse the Channels.txt file and process each channel
              awk -F'=' '
                /^Cat/ {Cat=$2}
                /^Name/ {Name=$2}
                /^VidLimit/ {VidLimit=$2}
                /^URL/ {URL=$2; print Cat, Name, VidLimit, URL}
              ' "$script_dir/Channels.txt" | while read -r Cat Name VidLimit URL; do
                  # Define the download directory for this channel
                  download_dir="$base_download_dir"
                  
                  # Define the download archive file for this channel
                  archive_file="$script_dir/DLarchive$Name.txt"
                  
                  # Create the download directory if it does not exist
                  mkdir -p "$download_dir"
                  
                  # If VidLimit is "ALL", set playlist_end option to empty, otherwise set it to --playlist-end <VidLimit>
                  playlist_end_option=""
                  if [[ $VidLimit != "ALL" ]]; then
                      playlist_end_option="--playlist-end $VidLimit"
                  fi
              yt-dlp \
                      --download-archive "$archive_file" \
                      $playlist_end_option \
                      --write-description \
                      --write-thumbnail \
                      --convert-thumbnails jpg \
                      --add-metadata \
                      --embed-thumbnail \
                      --match-filter "!is_live & !was_live & original_url!*=/shorts/" \
                      --merge-output-format mp4 \
                      --format "bestvideo[vcodec^=avc1]+bestaudio[ext=m4a]/best[ext=mp4]/best" \
                      --output "$download_dir/${Name} - %(title)s.%(ext)s" \
                      "$URL"
                      
              done
              
              • @Gutless2615@ttrpg.network
                link
                fedilink
                English
                19 months ago

                Yeah this is more elegant and closer to what I’d actually want to implement. I was more just showing what could be done in literally thirty seconds on the can with ChatGPT.

                • @webghost0101@sopuli.xyz
                  link
                  fedilink
                  English
                  19 months ago

                  I knew i recognized that output.

                  Mine is actually also made with the help of Chatgpt but manually refined and tested.

  • Lord Wiggle
    link
    fedilink
    English
    909 months ago

    You can still watch YouTube without ads using grayjay.app including sponsor block.

    Thanks to Louis Rossman