Tech Support Guy banner

Find a specific line in text using batch - Need Help

1305 Views 3 Replies 3 Participants Last post by  dvk01
Hi there,
I recently discovered how to download youtube videos manually by looking at the source code, and searching for specific encrypted url's which contain either the video or audio.

I want to make myself a batch file to make this process easier in the future, so here's what I want to do...

Search a file called "source.txt" (located in the same folder as the batch) for 3 different audio quality tags to see if they exist (some youtube videos will only contain "medium bitrate" quality audio, and so the source only contains that tag".
The three different tags are: "itag%3D139"(low bitrate audio), "itag%3D140"(medium bitrate audio) and "itag%3D141"(high bitrate audio).
So the batch should search for the highest bitrate file first (itag%3D141), and if it exists, return a user input saying "high bitrate audio was found. continue?(y/n)"
If that tag is not found, search for the next one down, and so on.
If user inputs "y" "GOTO DOWNLOAD". If not, "EXIT".

Ok, so now that the tag has been found, and the user has hit "y", the batch should now go back to that line in the text, then search for the first "\" symbol occurrence after that tag. The reason we are looking for the "\" is because this is the end of the URL we need to copy.
Once the batch finds the first \ that comes up after that tag, it should copy everything from the tag, up until the "\", and paste it into a new .txt file, then rename the new file to be a .html file.

That's it! After this is done, the batch should return an echo saying "link copy complete!" with a "pause..." after it.
Not open for further replies.
1 - 4 of 4 Posts
While I'm at it,
If someone could give any suggestions, I'm looking for a way to automate copying the source code from a youtube video URL to file using console?

I have tried this Wget code, but it seems to not be able to extract it...
(wget" --no-check-certificate -o code.txt)
Actual data, with the codes inside, is what someone needs to give you actual code that works.
I am sorry but we will not / cannot help you download youtube videos
Youtube is a streaming service that is designed not to allow downloads
please read the forum rules

Circumventing Company/School/Parental or Other Restrictions
Because we are unable to verify the actual situation or intent, no assistance will be provided to those trying to circumvent Internet filters or similar restrictions and any such threads will be closed. Furthermore, we will not assist with violating the "Terms of Service" of any product, service or web site. Unfortunately, it is against Google's Terms of Service to download videos from YouTube. They have contacted us directly to request that we do not support with downloading videos from YouTube. Any posts with instructions or information about how to violate Terms of Service will be closed or removed.
this is now closed
1 - 4 of 4 Posts
Not open for further replies.