Giter VIP home page Giter VIP logo

twixel's Introduction

Twixel

Unofficial C# Twitch.TV API Wrapper
Supports Twitch API v3 and most of v5
Supports .NET Core/.NET Standard
Official documentation can be found here

NuGet package supporting v2 and v3
Beta release of v5 support

Current Status

Twitch announced the next version of their API on August 31, 2017. See link v5 was deprecated and both v3 and v5 will be removed on December 31, 2018. Because of this the next updates to this library will be updates supporting the next version of Twitch's API.

Whenever that happens.

twixel's People

Contributors

b-barry avatar golf1052 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

twixel's Issues

Exception : System.FormatException

Hello,

I use your great library for a personal project. Everything works nice.
However, when I try to retrieve the featured stream. I got a exception.
I copy and past the code provided by your V3 test class.

Thank you in advance for your help.

Kinds regards

Exception    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
   at System.DateTime.Parse(String s)
   at TwixelAPI.Channel..ctor(Nullable`1 mature, String status, String broadcasterLanguage, String displayName, String game, Nullable`1 delay, String language, Int64 id, String name, String createdAt, String updatedAt, String logo, String banner, String videoBanner, String background, String profileBanner, String profileBannerBackgroundColor, Nullable`1 partner, String url, Nullable`1 views, Nullable`1 followers, JObject baseLinksO)
   at TwixelAPI.HelperMethods.LoadChannel(JObject o, APIVersion version)
   at TwixelAPI.Stream..ctor(Nullable`1 id, String game, Nullable`1 viewers, String createdAt, Int32 videoHeight, Double averageFps, String name, String broadcaster, JObject previewO, JObject channelO, JObject baseLinksO)
   at TwixelAPI.HelperMethods.LoadStream(JObject o, APIVersion version)
   at TwixelAPI.FeaturedStream..ctor(String text, String image, String tiUne exception de première chance de type 'System.NullReferenceException' s'est produite dans spot.exe
tle, Boolean sponsored, Int32 priority, Boolean scheduled, JObject streamO, JObject baseLinksO)
   at TwixelAPI.HelperMethods.LoadFeaturedStreams(JObject o, APIVersion version)
   at TwixelAPI.Twixel.<RetrieveFeaturedStreams>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

Hello,

let me say first that this API is great, I've been using it with success so far!

I encountered a surprising error while doing a simple query :

var twixel = new TwixelAPI.Twixel("abc123xyz", "");
var result = await twixel.RetrieveStreams(channels: listOfChannels);

got me a

Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonTextReader.ReadInternal()
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader)
   at Newtonsoft.Json.Linq.JObject.Parse(String json)
   at TwixelAPI.Twixel.<DoWebData>d__a5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---

Unfortunately I don't know what was the content of listOfChannels at the time of the crash, but I am positive that it was a normal list of channels (streamers names)

Since I am not able to find the cause and fix it, I thought maybe you would make more sense of it than me.

Enhancement Ideas

Thanks a lot for providing this API to the Twitch system. There are a couple of things that would be helpful for future users:

1 - I noticed that the Total Streams value is missing when you call the RetrieveStreams function. It would be nice to be able to see how many total streams there are on the system.

2 - Nice to have feature: Have the language constants defined. So that instead of EN, the user can display English.

Thanks again for providing this great library.
-- Steve

Add support for Twixel API v3

Library currently supports v2. Add support for v3 and allow the user to chose which API version they want to call from.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.