diff --git a/Cargo.toml b/Cargo.toml index f45a408..c240465 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ crossbeam-utils = "0.8.20" memoffset = "0.9.1" time = "0.3.36" rouille = "3.0" -reqwest = {version = "0.12", features = ["gzip","brotli","rustls-tls","deflate","cookies"]} +reqwest = {version = "0.12", features = ["gzip","brotli","rustls-tls","deflate","cookies","multipart"]} protobuf = "3.7.1" csv = "1.3" serde = { version = "1.0", features = ["derive"] } diff --git a/src/birch/get_agencies.rs b/src/birch/get_agencies.rs index cec907d..487be9c 100644 --- a/src/birch/get_agencies.rs +++ b/src/birch/get_agencies.rs @@ -4,10 +4,10 @@ use catenary::models::IpToGeoAddr; use catenary::postgis_to_diesel::diesel_multi_polygon_to_geo; use catenary::postgres_tools::{make_async_pool, CatenaryPostgresPool}; use catenary::EtcdConnectionIps; +use diesel::prelude::*; use diesel::ExpressionMethods; use diesel::SelectableHelper; use diesel_async::RunQueryDsl; -use diesel::prelude::*; use geojson::{Feature, GeoJson, JsonValue}; use ordered_float::Pow; use serde::Deserialize; diff --git a/src/maple/transitland_download.rs b/src/maple/transitland_download.rs index 71a2242..50d1dbc 100644 --- a/src/maple/transitland_download.rs +++ b/src/maple/transitland_download.rs @@ -46,6 +46,23 @@ async fn try_to_download( ) -> Result { let new_url = transform_for_bay_area(url.to_string()); + if feed_id == "f-dr5-nj~transit~rail" { + let form = reqwest::multipart::Form::new() + //i dont care, whatever, leak it, so what? + .text("token", "638671989162459331"); + + let request = client + .request( + reqwest::Method::POST, + "https://raildata.njtransit.com/api/GTFSRT/getGTFS", + ) + .multipart(form); + + let request = add_auth_headers(request, feed_id); + + return request.send().await; + } + let request = client.get(&new_url); let request = add_auth_headers(request, feed_id); diff --git a/src/models.rs b/src/models.rs index aa94098..10c62b9 100644 --- a/src/models.rs +++ b/src/models.rs @@ -5,13 +5,11 @@ use compact_str::CompactString; use diesel::pg::Pg; use diesel::prelude::*; -use diesel::FromSqlRow; +use diesel::sql_types::*; use serde_derive::Deserialize; use serde_derive::Serialize; use serde_json::Value; -use diesel::sql_types::*; - #[derive(Queryable, Selectable, Insertable, Clone, Serialize, Deserialize, QueryableByName)] #[diesel(table_name = crate::schema::gtfs::itinerary_pattern)] pub struct ItineraryPatternRow {