These are chat archives for MylesIsCool/ViaVersion

14th
May 2016
Florian
@sinnlosername
May 14 2016 11:27
Why not upload it on a fix link? :D
Like http://myles.us/ViaVersion/ViaVersion-LATEST.jar
Myles
@MylesIsCool
May 14 2016 13:49
Because of caching
Mats
@Matsv
May 14 2016 14:48
Isn't the cloudflare caching system checking if the file is the same with sha-1? Or something else
Florian
@sinnlosername
May 14 2016 15:08
I think it does
Mats
@Matsv
May 14 2016 15:09
Hm maybe not, in the past I had to enable 'development' mode if I wanted to change something on my website
Because it didn't got updated
But if it got uploaded on a LATEST link, older versions wouldn't be able to get downloaded from spigotmc.org though
Florian
@sinnlosername
May 14 2016 15:33
LATEST Link for auto updater plugins and version links for other versions meh
Mats
@Matsv
May 14 2016 15:34
Use spiget :D
Florian
@sinnlosername
May 14 2016 15:34
?
Mats
@Matsv
May 14 2016 15:34
spiget.org
they have a latest download function I tjink
Florian
@sinnlosername
May 14 2016 15:35
I don't know how to extract the link
^_^
Mats
@Matsv
May 14 2016 15:40
What do you mean? Don't you know how to handle the json data or how to send requests?
Florian
@sinnlosername
May 14 2016 15:41
I don't know how to get "the json data"
Mats
@Matsv
May 14 2016 15:41
Ah okay, what programming language do you use?
Florian
@sinnlosername
May 14 2016 15:41
Java ^.^
Mats
@Matsv
May 14 2016 15:41
Need help? :)
Florian
@sinnlosername
May 14 2016 15:41
If you gave me a link I know how to use it ^^
Mats
@Matsv
May 14 2016 15:42
Alright
Florian
@sinnlosername
May 14 2016 15:42
give*
Mats
@Matsv
May 14 2016 15:46
https://api.spiget.org/v1/resources/19254
And get the download link by the json key: "download"
Florian
@sinnlosername
May 14 2016 15:47
Thanks!
Mats
@Matsv
May 14 2016 15:47
Np :)
Florian
@sinnlosername
May 14 2016 15:48
Do I need to replace the \/ to /?
Mats
@Matsv
May 14 2016 15:48
I'm pretty sure java handles that
Florian
@sinnlosername
May 14 2016 15:58
I think I need some help :D
Mats
@Matsv
May 14 2016 15:58
Sup? :)
Florian
@sinnlosername
May 14 2016 15:58
yea :D
Mats
@Matsv
May 14 2016 16:07
Where do you need help with?
Florian
@sinnlosername
May 14 2016 16:07
Converting input stream 2 Stirng
String*
Mats
@Matsv
May 14 2016 16:08
Yes I'd convert it to string and parse it with gson
Florian
@sinnlosername
May 14 2016 16:08
And I search the way 2 convert it to string :D
Florian
@sinnlosername
May 14 2016 16:24
ty
Mats
@Matsv
May 14 2016 16:27
Hm, I'm pretty sure that gets redirected, but you can try
Florian
@sinnlosername
May 14 2016 16:30
"Server returned HTTP response code: 403"
Mats
@Matsv
May 14 2016 16:30
Hm forbidden
Florian
@sinnlosername
May 14 2016 16:30
:/
Mats
@Matsv
May 14 2016 16:30
Might be cloudflare?
What does the page content say?
Florian
@sinnlosername
May 14 2016 16:32
page content?
Mats
@Matsv
May 14 2016 16:32
The html
Might be cloudflare
that's blocking it
Florian
@sinnlosername
May 14 2016 16:32
There is no html O.o
Mats
@Matsv
May 14 2016 16:33
Do you send request with headers?
Or nothing
Florian
@sinnlosername
May 14 2016 16:33
URL url = new URL(getDownloadLink("https://api.spiget.org/v1/resources/19254"));
And ReadableByteChannel rbc = Channels.newChannel(url.openStream());
Mats
@Matsv
May 14 2016 16:42
Jup
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Access denied | www.spigotmc.org used CloudFlare to restrict access</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
<!--[if lte IE 9]><script type="text/javascript" src="/cdn-cgi/scripts/jquery.min.js"></script><![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script>

</head>
<body>
  <div id="cf-wrapper">
    <div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
    <div id="cf-error-details" class="cf-error-details-wrapper">
      <div class="cf-wrapper cf-header cf-error-overview">
        <h1>
          <span class="cf-error-type" data-translate="error">Error</span>
          <span class="cf-error-code">1010</span>
          <small class="heading-ray-id">Ray ID:  &bull; 2016-05-14 16:42:10 UTC</small>
        </h1>
        <h2 class="cf-subheadline" data-translate="error_desc">Access denied</h2>
      </div><!-- /.header -->

      <section></section><!-- spacer -->

      <div class="cf-section cf-wrapper">
        <div class="cf-columns two">
          <div class="cf-column">
            <h2 data-translate="what_happened">What happened?</h2>
            <p>The owner of this website (www.spigotmc.org) has banned your access based on your browser's signature (-ua21).</p>
          </div>


        </div>
      </div><!-- /.section -->

      <div class="cf-error-footer cf-wrapper">
  <p>
    <span class="cf-footer-item">CloudFlare Ray ID: <strong></strong></span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><sp
Florian
@sinnlosername
May 14 2016 16:43

Mats
@Matsv
May 14 2016 16:43
So, try to enable cookies and sending with a user agent
Florian
@sinnlosername
May 14 2016 16:43
How? D:
Mats
@Matsv
May 14 2016 16:45
con.setRequestProperty()
By setting the user agent
It gives 307
So temp moved
Florian
@sinnlosername
May 14 2016 16:49
Now I download an empty file
Mats
@Matsv
May 14 2016 16:51
@sinnlosername
public static void main(String[] args) throws IOException {
        URL url = new URL("https://www.spigotmc.org/resources/viaversion.19254/download?version=88294");
        HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
        con.setRequestProperty("User-Agent", "My awesome program");
        System.out.println(con.getResponseCode());

        String newurl = con.getHeaderField("location");
        System.out.println(newurl);

    }
Ofcourse instead of the direct download link you probably should use your getDownload() method
Florian
@sinnlosername
May 14 2016 16:57
Works
ty
Mats
@Matsv
May 14 2016 16:58
:)
Florian
@sinnlosername
May 14 2016 17:00
:D
Now I'll hope the ddos protection won't catch me :D
Mats
@Matsv
May 14 2016 17:01
How often do you check? ;)
Florian
@sinnlosername
May 14 2016 17:01
?
Mats
@Matsv
May 14 2016 17:01
For an update
Every hour?
Florian
@sinnlosername
May 14 2016 17:02
On every reload/restart of any game server
And I have many game servers. :D
Mats
@Matsv
May 14 2016 17:05
Ah, are you checking if the version changed?
Florian
@sinnlosername
May 14 2016 17:06
I can't because I use cloud system game servers which delete themself if they shut down. :D
Mats
@Matsv
May 14 2016 17:06
Ah ok
Florian
@sinnlosername
May 14 2016 17:07
Let's try it
Mats
@Matsv
May 14 2016 17:07
Don't you have a global plugin folder where they get the plugins from? ;)
Florian
@sinnlosername
May 14 2016 17:07
:D
I have a global plugin folder but it isn't so easy with 3 different root server meh
But I can try to download it into the folder :o:
lel :o:
Mats
@Matsv
May 14 2016 17:10
:D