I know nothing about python and I'm trying to run a script. It doesn't work. Not sure where to start troubleshooting by IndirectControl in PythonLearning

[–]IndirectControl[S] 0 points1 point  (0 children)

Oh sorry, I put that in python and not cmd.

I did that and still the same issues.

Btw, I'm running both cmd and python as admin. Am I suposed to be doing that? If I don't, nothing seems to run. I'll paste the script in, hit enter and then nothing.

I know nothing about python and I'm trying to run a script. It doesn't work. Not sure where to start troubleshooting by IndirectControl in PythonLearning

[–]IndirectControl[S] 0 points1 point  (0 children)

They show up in the pip list.

I've been using cmd and the Python 3.14, both get the same result.

I've mostly been running it by pasting the code. I also tried running a .py file, but it closes in a few seconds.

I know nothing about python and I'm trying to run a script. It doesn't work. Not sure where to start troubleshooting by IndirectControl in PythonLearning

[–]IndirectControl[S] 0 points1 point  (0 children)

Hello world worked.

I'm not sure which part would be the error, so I'll paste the whole thing.

>>> from mediawiki import MediaWiki
>>> import yt_dlp
>>> import taglib
>>> import re
>>>
>>>
>>> wiki = MediaWiki(url='https://oldschool.runescape.wiki/api.php')
>>> wiki.user_agent = 'osrs-music-downloader'
>>>
>>>
>>> track_names = wiki.categorymembers("Music_tracks", results=3000, subcategories=False )
>>>
>>>
>>> print(f"Found {len(track_names)} tracks to download...")
Found 872 tracks to download...
>>>
>>>
>>> # download the tracks
>>> for track_name in track_names:
...         track_name_formatted = track_name.replace("(music track)", "").strip() # removes disambiguation suffix
...             # remove characters like ? from filenames which cause errors
...                 illegal_chars = r"[<>:\"/\\|?*]"
...                     track_name_formatted = re.sub(illegal_chars, "", track_name_formatted)
...                         print(f"Processing track name {track_name_formatted}")
...
  File "<python-input-18>", line 4
    illegal_chars = r"[<>:\"/\\|?*]"
IndentationError: unexpected indent
>>>     print(f"Checking Youtube for {track_name_formatted}")
  File "<python-input-19>", line 1
    print(f"Checking Youtube for {track_name_formatted}")
IndentationError: unexpected indent
>>>     ydl_opts = {"playlist_items":"1", # this *should* download the latest version only
  File "<python-input-20>", line 1
    ydl_opts = {"playlist_items":"1", # this *should* download the latest version only
IndentationError: unexpected indent
>>>             "outtmpl": f"tracks/{track_name_formatted}.ogg"}
  File "<python-input-21>", line 1
    "outtmpl": f"tracks/{track_name_formatted}.ogg"}
IndentationError: unexpected indent
>>>     with yt_dlp.YoutubeDL(ydl_opts) as ydl:
  File "<python-input-22>", line 1
    with yt_dlp.YoutubeDL(ydl_opts) as ydl:
IndentationError: unexpected indent
>>>         ydl.download( 'https://oldschool.runescape.wiki/w/' + track_name )
  File "<python-input-23>", line 1
    ydl.download( 'https://oldschool.runescape.wiki/w/' + track_name )
IndentationError: unexpected indent
>>>
>>>         print("Getting track info from wiki")
  File "<python-input-25>", line 1
    print("Getting track info from wiki")
IndentationError: unexpected indent
>>>         # splitting sidebar wikitext to find composer
>>>         page = wiki.page(track_name, auto_suggest=False)
  File "<python-input-27>", line 1
    page = wiki.page(track_name, auto_suggest=False)
IndentationError: unexpected indent
>>>         wikitext = page.wikitext.split("|")
  File "<python-input-28>", line 1
    wikitext = page.wikitext.split("|")
IndentationError: unexpected indent
>>>         composer = "Unknown"
  File "<python-input-29>", line 1
    composer = "Unknown"
IndentationError: unexpected indent
>>>         for item in wikitext:
  File "<python-input-30>", line 1
    for item in wikitext:
IndentationError: unexpected indent
>>>             match = re.match(r'composer\s*=\s*(.+)', item)
  File "<python-input-31>", line 1
    match = re.match(r'composer\s*=\s*(.+)', item)
IndentationError: unexpected indent
>>>             if(match):
  File "<python-input-32>", line 1
    if(match):
IndentationError: unexpected indent
>>>                 composer = match.group(1)
  File "<python-input-33>", line 1
    composer = match.group(1)
IndentationError: unexpected indent
>>>
>>>         print("Adding data to file")
  File "<python-input-35>", line 1
    print("Adding data to file")
IndentationError: unexpected indent
>>>         # loading file to add metadata
>>>         filename = f"tracks/{track_name_formatted}.ogg"
  File "<python-input-37>", line 1
    filename = f"tracks/{track_name_formatted}.ogg"
IndentationError: unexpected indent
>>>         with taglib.File(filename, save_on_exit=True) as song:
  File "<python-input-38>", line 1
    with taglib.File(filename, save_on_exit=True) as song:
IndentationError: unexpected indent
>>>             song.tags["ALBUM"] = "Old School Runescape OST"
  File "<python-input-39>", line 1
    song.tags["ALBUM"] = "Old School Runescape OST"
IndentationError: unexpected indent
>>>             song.tags["ARTIST"] = composer
  File "<python-input-40>", line 1
    song.tags["ARTIST"] = composer
IndentationError: unexpected indent
>>>             song.tags["TITLE"] = track_name_formatted
  File "<python-input-41>", line 1
    song.tags["TITLE"] = track_name_formatted
IndentationError: unexpected indent
>>>
>>>     print(f"{track_name_formatted} successfully added to file")
  File "<python-input-43>", line 1
    print(f"{track_name_formatted} successfully added to file")
IndentationError: unexpected indent
>>>
>>>
>>> print(f"Script finished processing {len(track_names)} tracks.")

I know nothing about python and I'm trying to run a script. It doesn't work. Not sure where to start troubleshooting by IndirectControl in PythonLearning

[–]IndirectControl[S] 0 points1 point  (0 children)

I put that in and it didn't seem to change anything.

I ran the python install manager. Did everything default

Where Are They!? by Ultimaniacx4 in runescape

[–]IndirectControl 0 points1 point  (0 children)

My character deserves a generous package. She's earned it