use of me.postaddict.instagram.scraper.interceptor.FakeBrowserInterceptor in project instagram-java-scraper by postaddictme.
the class AnonymousInstaTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient httpClient = new OkHttpClient.Builder().addNetworkInterceptor(loggingInterceptor).addInterceptor(new FakeBrowserInterceptor(UserAgents.OSX_CHROME)).addInterceptor(new ErrorInterceptor()).cookieJar(new DefaultCookieJar(new CookieHashSet())).build();
client = new Instagram(httpClient);
client.basePage();
}
use of me.postaddict.instagram.scraper.interceptor.FakeBrowserInterceptor in project instagram-java-scraper by postaddictme.
the class MultiThreadTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient httpClient = new OkHttpClient.Builder().addNetworkInterceptor(loggingInterceptor).addInterceptor(new FakeBrowserInterceptor(UserAgents.OSX_CHROME)).addInterceptor(new ErrorInterceptor()).cookieJar(new DefaultCookieJar(new CookieHashSet())).build();
client = new Instagram(httpClient);
client.basePage();
}
use of me.postaddict.instagram.scraper.interceptor.FakeBrowserInterceptor in project instagram-java-scraper by postaddictme.
the class StatelessInstaTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);
OkHttpClient httpClient = new OkHttpClient.Builder().addNetworkInterceptor(loggingInterceptor).addInterceptor(new FakeBrowserInterceptor(UserAgents.OSX_CHROME)).addInterceptor(new ErrorInterceptor()).build();
client = new Instagram(httpClient);
client.basePage();
}
use of me.postaddict.instagram.scraper.interceptor.FakeBrowserInterceptor in project instagram-java-scraper by postaddictme.
the class AuthenticatedInstaTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
Credentials credentials = new Credentials();
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);
OkHttpClient httpClient = new OkHttpClient.Builder().addNetworkInterceptor(loggingInterceptor).addInterceptor(new FakeBrowserInterceptor(UserAgents.OSX_CHROME)).addInterceptor(new ErrorInterceptor()).cookieJar(new DefaultCookieJar(new CookieHashSet())).build();
client = new Instagram(httpClient);
client.basePage();
client.login(credentials.getLogin(), credentials.getPassword());
client.basePage();
}
use of me.postaddict.instagram.scraper.interceptor.FakeBrowserInterceptor in project instagram-java-scraper by postaddictme.
the class AuthenticatedInstaTest method testLoginWithInvalidCredentials.
@Test(expected = InstagramAuthException.class)
public void testLoginWithInvalidCredentials() throws Exception {
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);
OkHttpClient httpClient = new OkHttpClient.Builder().addNetworkInterceptor(loggingInterceptor).addInterceptor(new FakeBrowserInterceptor(UserAgents.OSX_CHROME)).addInterceptor(new ErrorInterceptor()).cookieJar(new DefaultCookieJar(new CookieHashSet())).build();
Instagram instagramClient = new Instagram(httpClient);
instagramClient.basePage();
instagramClient.login("1", "2");
}
Aggregations