avatarJIN

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2482

Abstract

But I learned to forgive. I learned to practise empathy and understand the 7-year-old, I knew she hadn’t intended to hurt Betsy. We never told her that Besty died but I am sure she would have been mortified and filled with remorse for a long time. That idea of empathy, the understanding that people have different values, priorities or ethics and behave in different ways has always helped me to forgive. I did not believe in carrying grudges, life was too short to be resentful.</p><p id="b8f5" type="7">That same idea of empathy and forgiveness was also the reason I stayed in abusive relationships</p><h2 id="1ccb">Abusers use forgiveness against you</h2><p id="ff7a"><i>“You are not being fair, people make mistakes!” “Come on, that was ages ago, have you still not forgiven me?” “I said I was sorry, what more do you want?”</i></p><p id="3167">These are some of the things my ex would say when I got upset about his behaviour. When you are in an abusive relationship, the concept of forgiveness can quickly become a weapon the abuser uses to keep you trapped. The idea that you must forgive them is like permission to continue with the abuse. Lundy Bancroft, who has worked with over 2000 abusive men writes:</p><p id="7386" type="7">“My clients demand forgiveness while continuing to insult, threaten, demand immediate responses, attend only to their own needs, and more.” (Why Does He Do That? p. 217)</p><h2 id="f5de">Forgiveness requires remorse</h2><p id="9234">I always thought forgiveness was unconditional. Although I am not religious, I was brought up going to church and reading the bible. The concept of forgiveness I had was influenced by the phrases and sermons I had picked up at a young age. <i>“Bear with each other and <b>forgive</b> one another if any of you has a grievance against someone. <b>Forgive</b> as the Lord forgave you.” </i>I thought it meant that you have to forgive everyone and anyone no matter what they had done. But there is one point I never knew: This idea of forgiveness is based on the assumption that the person I am forgiving shows remorse.</p><p id="c92b" type="7">Overlooked in common Christian understanding of forgiveness is the necessary part of repentance by the wrongdoer. John McKinley</p><p id="d22c">One of the most difficult concepts to understand after <a href="https://readmedium.com/13-signs-i-dated-a-narcissist-44d1db6ee3e4">my relationship with a narcissist</a> was that there are people who are incapable of feelin

Options

g remorse. He never apologised or cared about what happened to me. When he left, it was as if he had turned off a switch, his new victim was all that mattered and I never existed. Part of me was hoping for a long time that I would receive an apology. But I know that it will not happen. Although I understand now <a href="https://readmedium.com/how-a-narcissist-prepares-you-for-the-abuse-6383e7c92873">how abusive he was</a>, in his mind, he has done nothing wrong. <i>He does not seek forgiveness.</i></p><h2 id="5d37">Forgive yourself</h2><p id="46a4">I don’t think I need to forgive him to lead a happier and healthier life. I do not believe that forgiveness is part of the healing process unless it is directed at myself. <i>Forgiving yourself is key</i>.</p><p id="7171">Forgive yourself for not seeing it, for staying longer than you should have. Forgive yourself for moments you were weak and for moments when you might feel week again. Forgive yourself for ways you have behaved or things you have said. Forgive yourself for all the things you feel remorse over. Forgive yourself for never being able to forgive those that show no remorse.</p><h2 id="2210">More from Kara Summers:</h2><div id="b84b" class="link-block"> <a href="https://readmedium.com/do-you-feel-like-you-are-constantly-upsetting-your-partner-b1e9f5fcd6df"> <div> <div> <h2>Do You Feel Like You Are Constantly Upsetting Your Partner?</h2> <div><h3>Make sure you aren’t the one who is the real victim.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*7hsqJBnmFY3IjI7k)"></div> </div> </div> </a> </div><div id="fc43" class="link-block"> <a href="https://readmedium.com/a-day-in-the-life-of-a-toxic-relationship-ffb487a213ec"> <div> <div> <h2>A Day in the Life of a Toxic Relationship</h2> <div><h3>Many don’t recognise narcissistic abuse when they are caught in the middle.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*ul7zBaj8k26PDM4k)"></div> </div> </div> </a> </div></article></body>

Photo by Szabo Viktor on Unsplash

Downloading YouTube Videos Using Python: A Step-by-Step Guide

Learn How to Automate the Downloading of YouTube Videos Using Python

Thank you for being a part of this journey with me, and I hope to continue providing value to you for years to come! Giving tips by supporting me.

Hello friend, I hope you’re doing well! I’m writing to you today because I am truly passionate about sharing my knowledge and helping others learn. If you’ve found my articles to be valuable and they’ve made a positive impact on your life, I would be overjoyed if you could support me as a referred member. Your support not only helps me financially but also motivates me to continue creating content that makes a difference in people’s lives. Thank you from the bottom of my heart for considering supporting me. It means the world to me to have your support on this journey.

Read my previous articles

Python with the help of the pytubemodule can be used to easily download YouTube videos, which is an integral part of our daily lives, providing endless streams of entertaining, informative, and educational videos. Although there are many tools available online to download YouTube videos, they may not always be reliable or efficient. In this article, we will show you how to download YouTube videos using Python with the help of the pytubemodule, a lightweight library that enables quick and easy YouTube video downloads. With the help of the pytubemodule, you can automate the process of downloading YouTube videos and integrate them into your scripts or projects.

The pytube module is a Python tool used for downloading YouTube videos. It is easy to use, even if you are new to Python, and can be used on any operating system that supports Python. Using pytube, you can easily customize the quality and format of the video you want to download. You can also extract audio from videos and convert them to different file formats like MP3 or WAV.

Here’s how you can download YouTube videos using Python with the help of thepytube module:

  • Step 1: Install the pytube Module

The pytube module can be easily installed using pip, which is a package manager for Python. Open a command prompt or terminal window and type the following command:

pip install pytube

This command will download and install the pytube module and all its dependencies.

  • Step 2: Import the pytube Module and Create a YouTube Object

Before using pytube, you need to import it into your Python script. To import the pytube module, add the following code at the beginning of your script:

from pytube import YouTube

This code imports the YouTube class from the pytubemodule, which allows you to create a YouTubeobject that represents the video you want to download. To create a YouTube object, you need to provide the URL of the YouTube video you want to download.

To create a YouTube object, you need to provide the URL of the YouTube video you want to download.

yt = YouTube('https://www.youtube.com/watch?v=dQw4w9WgXcQ')

This code creates a YouTube object called yt that represents the video with the URL https://www.youtube.com/watch?v=dQw4w9WgXcQ. You can now use this object to access information about the video and download it.

Step 3: Print Video Information and Select the Stream

After creating a YouTubeobject, you can access information about the video using its attributes and methods. For example, you can print the title and duration of the video like this::

print("Title:", yt.title)
print("Description:", yt.description)
print("Author:", yt.author)
print("Length:", yt.length, "seconds")
Image Credit: Author

This code prints the title and duration of the video represented by the YouTube object yt. To download the video, you need to select a specific stream, which is a version of the video with a specific resolution and format. The pytube module provides a streams attribute for the YouTube object, which is a list of all available streams for the video. You can print the available streams like this:

for stream in yt.streams:
    print(stream)

This code prints information about all available streams for the video represented by the YouTube object yt.

This code prints information about all available streams for the video represented by the YouTube object yt. To select a specific stream, you need to filter the list of streams based on your desired resolution and format. For example, if you want to download the video in the highest available resolution and the MP4 format, you can use the filter() method to select the stream that meets your criteria:

stream = yt.streams.filter(res='1080p', mime_type='video/mp4').first()
Image Credit: Author

This code selects the first stream in the list of streams that have a resolution of 1080p and a mime_type of video/mp4, which is the highest-resolution MP4 stream. You can now use this stream to download the video.

Next, you need to select the stream (i.e., the video and audio quality) you want to download. You can use the streams property of the YouTube object to get a list of all available streams. For example:

streams = yt.streams.all()

for stream in streams:
    print(stream)

This will print a list of all available streams with their resolution, file format, and other information. You can select the stream you want by using its itag attribute. For example, to select the highest resolution stream, you can use the following code:

ys = yt.streams.get_highest_resolution()
  • Step 4: Set the Output Path and Download the Video

After selecting the stream, you need to specify the output path where you want to save the downloaded video. You can do this by setting the output_path attribute of the stream object. For example, if you want to save the video in the current working directory, you can set the output path like this:

stream.output_path = '.'

This code sets the output path of the stream to the current working directory.

To download the video, you can call the download() method of the stream object, like this:

stream.download()

This code downloads the video and saves it to the output path specified in the previous step.

If you want to display the progress of the download, you can pass a progress function to the download() method. For example, you can define a function that prints the download progress as a percentage, like this:

def on_progress(stream, chunk, bytes_remaining):
    total_size = stream.filesize
    bytes_downloaded = total_size - bytes_remaining
    percentage = bytes_downloaded / total_size * 100
    print(f'{percentage:0.2f}% downloaded...')

This code defines a function on_progress that takes three arguments: stream, chunk, and bytes_remaining. The stream argument is the stream object being downloaded, the chunk argument is the current chunk of data being downloaded, and the bytes_remaining argument is the number of bytes remaining to download. The function calculates the percentage of the video that has been downloaded and prints it to the console.

You can pass this function to the download() method like this:

stream.download(output_path='.', filename='my_video.mp4', on_progress=on_progress)This code downloads the video and displays the download progress in the console

This code downloads the video and saves it to a file called my_video.mp4 in the current working directory. The on_progress on_progress function is called periodically during the download to display the progress of the download.

Additionally, it’s important to note that downloading videos from YouTube is against the platform’s terms of service, and it may result in the termination of your account. Therefore, it’s important to use this method only for personal use or for educational and research purposes, and not for commercial or public distribution. Always make sure to respect the intellectual property rights of content creators and follow the laws and regulations of your country or region.

Final Script

# Import the necessary module
from pytube import YouTube

# Provide the YouTube video URL
video_url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

# Create a YouTube object
yt = YouTube(video_url)

# Print video information
print("Title:", yt.title)
print("Description:", yt.description)
print("Author:", yt.author)
print("Length:", yt.length, "seconds")

# Select the highest resolution stream
stream = yt.streams.get_highest_resolution()

# Set the output path
stream.output_path = '.'

# Define progress function
def on_progress(stream, chunk, bytes_remaining):
    total_size = stream.filesize
    bytes_downloaded = total_size - bytes_remaining
    percentage = bytes_downloaded / total_size * 100
    print(f'{percentage:0.2f}% downloaded...')

# Download the video
stream.download(on_progress=on_progress)

print("Video downloaded successfully!")

Replace the video_url variable with the YouTube video URL you want to download and run the script. It will download the video and save it in the current working directory. You can customize the output path and other /options as needed by modifying the code.

Note: the content generated by ChatGPT is not written by a human author, but rather by an AI language model trained by OpenAI.

If you’ve found any of my articles helpful or useful then please consider throwing a coffee my way to help support my work or give me patronage😊, by using

Patreon

Ko-fi.com

buymeacoffee

Last but not least, if you are not a Medium Member yet and plan to become one, I kindly ask you to do so using the following link. I will receive a portion of your membership fee at no additional cost to you.

More content at PlainEnglish.io.

Sign up for our free weekly newsletter. Follow us on Twitter, LinkedIn, YouTube, and Discord.

Interested in scaling your software startup? Check out Circuit.

YouTube
Python
Programming
Automation
Code
Recommended from ReadMedium