Python subtitles from youtube

I wrote a code but it doesn’t work couly you help me to find a mistake? from youtube_transcript_api import YouTubeTranscriptApi import os srt = YouTubeTranscriptApi.get_transcript("SW14tOda_kI") text = "" with open("file.txt", "w") as file: for i in srt: text += i["text"] + "\n" file.write(text) os.startfile("file.txt") >Solution : You have indentation problem. the correct code is: from… Read More Python subtitles from youtube

Why inserting of YouTube video doesn't work in the case of nested frames

I have the following files: index.htm <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> iframe { border: none; display: block; } </style> </head> <body> <iframe id="main-frame" src="child.htm" frameborder="0" sandbox="allow-same-origin" allowfullscreen></iframe> </body> </html> child.htm <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <iframe width="640" height="480" src="https://www.youtube.com/embed/jNQXAC9IVRw&quot; title="Me at the… Read More Why inserting of YouTube video doesn't work in the case of nested frames

Why is my text going vertical at a certain width?

So I have an issue with my code where when my JavaScript types of a word (eg. Gamer) it limits to a certain width and ends up going vertical instead of horizontal. Here are all the classes and code for the text: // TYPEWRITER // const typedTextSpan = document.querySelector(“.typed-text”); const cursorSpan = document.querySelector(“.cursor”); const textArray… Read More Why is my text going vertical at a certain width?

Convert ASCII to hex

I want convert ASCII values to hex. In Java, I often use the function: private static String asciiToHex(String asciiStr) { char[] chars = asciiStr.toCharArray(); StringBuilder hex = new StringBuilder(); for (char ch : chars) { hex.append(Integer.toHexString((int) ch)); } return hex.toString(); } Is there any method in Dart to convert to hex value like Integer.toHexString in… Read More Convert ASCII to hex

React 18, useEffect is getting called two times

I have a counter and set console.log on useEffect to log every change in my state but the useEffect calls twice!!!! import { useState, useEffect } from "react"; const Counter = () => { const [count, setCount] = useState(5); useEffect(() => { console.log("rendered"); console.log(count); }, [count]); console.log("rendered"); return ( <div> <h1> Counter </h1> <div> {count}… Read More React 18, useEffect is getting called two times