[1.7.10] fix computercraft pastebin

Dieses Thema im Forum "Tutorials, Tips and Tricks" wurde erstellt von p5k, 20. Januar 2022.

  1. p5k

    p5k Well-Known Member

    Beiträge:
    247
    Zustimmungen:
    205
    Ortszeit:
    17:19
    On 1.7.10 computercraft pastebin seems to be broken, as the raw url was changed. This can be fixed quite easily within the computer:

    Code:
    copy rom/programs/http/pastebin pastebin
    edit pastebin
    
    Go to line 24 and change
    Code:
    "http://pastebin.com/raw.php?i="..textutils.urlEncode( paste )
    to
    Code:
    "https://pastebin.com/raw/"..textutils.urlEncode( paste )
    After that, pastebin get should work on that computer.
    There may be a way to apply this server-wide.
     
  2. BookerTheGeek

    BookerTheGeek Patron Tier 3

    Beiträge:
    3.257
    Zustimmungen:
    1.097
    Ortszeit:
    10:19
    This can be added to the launcher so that it is automatically fixed for everyone using the MyM launcher

    Place THIS in the Minecraft installation directory's "resourcepack" subfolder and restart the game. MyM will also need to put it in place within the server's installation directory also and restart the server.

    This is from the CC Forums as a fix, listed here


    EDIT: Outdated it seems.

    1. Open computer
    2. open lua
    3. paste the following and hit enter
      • Code:
        local r = http.get("https://pastebin.com/raw/jCfCfBPn"); local f = fs.open( shell.resolve( "pastebin" ), "w" ); f.write( r.readAll() ); f.close(); r.close()
    4. Fixed
    This is from a YouTube video, and I've used it for as long as this issue has been around.
     
    Zuletzt bearbeitet: 20. Januar 2022
  3. p5k

    p5k Well-Known Member

    Beiträge:
    247
    Zustimmungen:
    205
    Ortszeit:
    17:19
    This one is outdated as well. Note that it uses http and not https, so it doesn't work, though it could easily be adapted
     
    BookerTheGeek gefällt das.
  4. BookerTheGeek

    BookerTheGeek Patron Tier 3

    Beiträge:
    3.257
    Zustimmungen:
    1.097
    Ortszeit:
    10:19
    Updated my post.
     
  5. p5k

    p5k Well-Known Member

    Beiträge:
    247
    Zustimmungen:
    205
    Ortszeit:
    17:19
    here is an updated version that i made
    EDIT: pastebin put is now also fixed
     
    Zuletzt bearbeitet: 27. Januar 2022
  6. TomboyEnthusiast

    TomboyEnthusiast Well-Known Member

    Beiträge:
    991
    Zustimmungen:
    404
    Ortszeit:
    11:19
    Sorry to revive such an old thread.

    There appears to be a new issue related to Pastebin, they now require a User-agent header to be included. I have patched the pastebin script to add it, and here is a new one-liner to download the new working version

    1. Type lua to get to a lua interpreter
    2.
    Code:
    local r = http.get("https://pastebin.com/raw/mihSzyQD", {["User-agent"] = "ComputerCraft HTTP API"}); local f = fs.open( shell.resolve( "pastebin" ), "w" ); f.write( r.readAll() ); f.close(); r.close(); exit()
    3. Use the new pastebin script ./pastebin get <scriptID> <fileName>
     

Diese Seite empfehlen