Enkelt skript för att fånga rssfeed från youtube

källa: https://github.com/amoore17/youtube-rss-finder/blob/master/rss-fetch.py

import urllib.request
import re

to_file = ""
output_file = ""
file_exists = False

while (to_file == ""):
    print()
    to_file = input("Would you like to export your RSS feeds to a file? (\"y\" or \"n\"): ")
    
    if (to_file == "y"):
        to_file = True

        option = ""
        
        while (option == ""):
            print()
            output_file = input("Enter name of the output file: ")

            try:
                open(output_file)
                file_exists = True
            except:
                file_exists = False

            if (file_exists == True):
                print()
                print("A file of that name already exists")
                print()
                print("Would you like to: ")
                print("1. Append to file")
                print("2. Overwrite")
                print("3. Specify different name")
                print("4. Quit")
                print()
                option = int(input("Enter a number: "))

                if (option == 1):
                    f = open(output_file, "a+")
                elif (option == 2):
                    f = open(output_file, "w+")
                elif (option == 3):
                    option = ""
                    continue
                else:
                    quit()
            else:
                f = open(output_file, "w+")
                break
    elif (to_file == "n"):
        to_file = False
    else:
        to_file = ""
        print()
        print("Invalid option")
        continue

ans = 'y'

while (ans == 'y' or ans == 'Y'):
    print()
    url = input("Enter YouTube URL: ")
    req = urllib.request.Request(url)
    resp = urllib.request.urlopen(req)
    respData = resp.read().decode("utf-8")

    # Search for RSS in the HTML
    try:
        rss = re.findall(r'channel_id=(.*)"', respData)
        rss = "https://www.youtube.com/feeds/videos.xml?channel_id=" + rss[0]
        
        if (to_file == True):
            f.write(rss + "\n")
            print()
            print("Outputted to \"" + output_file + "\"")
        else:
            print()
            print(rss)
    # Else search for RSS in the channel name
    except:
        try:
            rss = re.findall(r'/channel/(.*)', url)
            rss = "https://www.youtube.com/feeds/videos.xml?channel_id=" + rss[0]
            
            if (to_file == True):
                f.write(rss + "\n")
                print()
                print("Outputted to \"" + output_file + "\"")
            else:
                print()
                print(rss)
        except:
            print()
            print("Unable to find RSS")

    print()
    ans = input("Would you like to enter another url? ('y' or 'n'): ")

print()

Eget enkelt rollspel

Saxat från ett eget inlägg på social medier:

Min 9åriga son satt och tecknade. När jag sneglade närmare såg jag att det var en dungeon. Med fällor och gångar. Han hade just börjat. När han såg att jag sneglade frågar han om jag ville spela. Självklart satte jag mig ner och han började spelleda mig. Jag fick vapen: ett svärd, ett armborst som skjuter knivar – vilket är bra för närstrid – och en oändlighetssäck. “Ni vet en sådan där som rymmer allt.”

Vi hade bara en T6 men allt eftersom klurade han ut svårighetsgrader för att träffa och uppgifter. Skadan var en enkel T6.

Jag har hittills hittar och dödar två kyklingätande-skelett och tack vare att tärningen visade en etta missade jag en hemlig gång i botten av en kista.

Tillsammans klurade vi ut att man kan få minus på olika färdighetsslag. Ex: Armborstet har en räckvidd på 10m (10 rutor i anteckningsboken) men efter fem meter får jag -1 på min skadetärning.

Detta kommer så klart ändras och diskuteras. MEN vad roligt. Han tänker och klurar. Funderar på vad som är möjligt till skillnad till vad som är roligt osv. Det behövs inte mycket för att spela.

Whiff

Intressant tabell.

From: https://imaginaryhallways.blogspot.com/2019/12/whiff-table-something-happens-every.html

 

I’m thinking of running 0e DnD or Black Pudding‘s flavor of B/X, or Moldhammer, or Wolfbreaker. But I love combat systems from Into the Odd where there’s no to-hit roll (and no missing) or Troika/Tunnel Goons/Macchiato Monsters where someone always gets hit. What to do? Write a whiff table!

When two opposed combatants in melee both miss their attacks, roll on the whiff table.

  1. You knock each other’s helms off. If anyone involved is not wearing a helm, they take 1d6 damage.
  2. You both fall down. 50% chance you’re on top. You’re at a range where punches, kicks, and daggers will work; larger melee weapons will not.
  3. You bind weapons and then push one another back. Their weapon lands at your feet; yours lands at theirs.
  4. Belt or backpack cut. Lose the top item in your inventory, as it is on the ground now.
  5. Lesser HD combatant knocked back into someone else on their side, who must save or be knocked down.
  6. Environmental damage! Crack the ceiling, start a fire, destroy furniture, valuables, etc.
  7. Tooth loosened. You can spit it out in their face for a +4 to hit bonus next round, or try to keep it in place and get it fixed later (maybe?). No hp loss.
  8. Metal strikes stone. You and your opponent are bathed in sparks. Exposed paper or oil will begin to burn. Hair smolders.
  9. Opponent had an oil jar or gland that you just barely nick, but it splits open nevertheless. You, your opponent, and the ground are drenched in oil.
  10. You just barely get an opening. If you swing with everything you have, embedding your weapon in your opponent, you can do so and roll damage with advantage, but you lose your weapon. Otherwise, normal miss.
  11. Their swing or thrust misses, but tosses sweat and grit in your eyes. Take -4 to AC until you spend a round wiping that out; your peripheral vision is .
  12. You clash weapons and it’s incredibly loud. Roll for an additional encounter.
  13. You disarm them and their weapon sails behind them. If they have natural weapons they take 1d6 damage.
  14. Their weapon pins you in place. They lose it but you will have to struggle for 1d3 rounds to be able to move again. Can still fight.
  15. Ancient war-sigil mine stepped on, 1-3 by you, 4-6 by enemy. Spend next round levitating 10′ in the air. Spells lowers you down gently (defective).
  16. Skyknife! Your weapon is knocked up into the ceiling and lodged there. It’ll fall in 1d6 rounds. Anyone under it could be hit by it. (If no ceiling is available your weapon targets someone random closeby.)
  17. Ambient magical energy interacts with your intent to cause harm. You and your opponent glow like torches. -4 AC penalty to both of you for 1d6 rounds.
  18. You blink blood out of your eyes. You and your opponent are covered in blood and gore. Perhaps another attack drenched you both, perhaps some blood god is merely happy at your mishap.
  19. Their swing is about to cleave into your throat and you are suddenly in the Dead Realm. Any spirits or undead in the area are still present, otherwise it is empty, grey, cold, foggy. You can move about for 1 round and then you will re-appear wherever you moved to. Any valuable treasure or items are but dust in the Dead Realm, unless you brought them in yourself.
  20. Both of your weapons bind and break. If either of you were using magical weapons, said weapons can save against breakage. (Roll a 4 or more on a d6, adding the weapon’s magical bonus.)
You could just roll a d6 against this table, or a d12 if you don’t want random magical war-sigils to show up in your theatre of the mind, or random Dead Realm trips.