Python Forum
Highlight and remove specific string of text
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Highlight and remove specific string of text
#1
Ok sorry for my newb question, but I figured this was the best place to start. (no real python Knowledge)

Basically I am using a program Called EventGhost and from what I understand it uses Python.
I have a basic script that upon pressing a key, will highlight the browser and copy it to the clipboard
to then paste it into a Program to download the youtube videos for personal studies.

The only real issue with this script I have encountered is any video that is part of a playlist wich always
includes a &list= in the URL will cause the download program to download the entire playlist. now on a playlist's
main page, I can use the Url if I needed to copy all videos in it, but for individual videos I want that exist with
the &list= in the Url it's frustrating to have to delete this part and makes the script useless.

Ok so my question is can I make a basic python script that will take the clipboard after copying the URL and remove
the text &list= and all after it if it's in the URL and then paste it afterward in the download program?

Eventghost is basically a easy to use if this then that program that has various actions to execute
(Move mouse here, close this window, hit this key, ETC..) One of these actions is execute python script, this is why I am here.
Reply
#2
You can post your code here. Use BB-Code tags

If you use youtube-dl for this task, you should add the parameter --no-playlist
My code examples are always for Python >=3.6.0
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#3
well, I use Youtube-dlg which, if I understand correctly, is youtube-dl but with a GUI. And the eventghost script is basically a macro for it to press a sequence of keys and initiate mouse clicks

here is what I am using
[Image: yQVFKHW]
Reply
#4
Your image is not uploaded. Please check it.
Reply
#5
Link to picture of my program
Reply
#6
As was requested the first time, use BBCode. Most of us (myself included) aren't going to look at a picture of your code, but we'd be glad to help if you follow the rules.
Feel like you're not getting the answers you want? Checkout the help/rules for things like what to include/not include in a post, how to use code tags, how to ask smart questions, and more.

Pro-tip - there's an inverse correlation between the number of lines of code posted and my enthusiasm for helping with a question :)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Remove specific elements from list with a pattern Xalagy 3 289 Oct-11-2020, 07:18 AM
Last Post: Xalagy
  How to remove char from string?? ridgerunnersjw 2 111 Sep-30-2020, 03:49 PM
Last Post: ridgerunnersjw
  Printing string at specific position on terminal - not showing __Mathieu__ 1 154 Sep-07-2020, 10:32 AM
Last Post: Larz60+
  Extracting data based on specific patterns in a text file K11 1 285 Aug-28-2020, 09:00 AM
Last Post: Gribouillis
  can't save text string branko316 2 373 May-31-2020, 02:46 PM
Last Post: branko316
  Read Multiples Text Files get specific lines based criteria zinho 5 555 May-19-2020, 12:30 PM
Last Post: zinho
  Remove from end of string up to and including some character lbtdne 2 445 May-17-2020, 09:24 AM
Last Post: menator01
  Remove escape characters / Unicode characters from string DreamingInsanity 5 828 May-15-2020, 01:37 PM
Last Post: snippsat
  How to extract specific rows and columns from a text file with Python Farhan 0 465 Mar-25-2020, 09:18 PM
Last Post: Farhan
  How to compare two columns and highlight the unique values of column two using pandas shubhamjainj 0 833 Feb-24-2020, 06:19 AM
Last Post: shubhamjainj

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020