Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #155 from makisukurisu/danbooru_downloads
Browse files Browse the repository at this point in the history
fix: Add User-Agent header to fix CDN blockage
  • Loading branch information
nullxception authored Jul 5, 2024
2 parents 755d1ac + a902dc7 commit 7c80b72
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true,
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
}
12 changes: 7 additions & 5 deletions lib/presentation/provider/download/downloader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ class Downloader {
await sharedStorageHandle.init();

final taskId = await FlutterDownloader.enqueue(
url: fileUrl,
fileName: fileName,
savedDir: targetPath ?? sharedStorageHandle.path,
showNotification: true,
openFileFromNotification: true);
url: fileUrl,
fileName: fileName,
savedDir: targetPath ?? sharedStorageHandle.path,
showNotification: true,
openFileFromNotification: true,
headers: {'User-Agent': 'Boorusphere/1.4.3'},
);

if (taskId != null) {
final entry = DownloadEntry(
Expand Down
124 changes: 74 additions & 50 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ packages:
dependency: "direct main"
description:
name: collection
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.1"
version: "1.18.0"
convert:
dependency: transitive
description:
Expand All @@ -213,10 +213,10 @@ packages:
dependency: transitive
description:
name: coverage
sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097"
sha256: "8acabb8306b57a409bf4c83522065672ee13179297a6bb0cb9ead73948df7c76"
url: "https://pub.dev"
source: hosted
version: "1.6.3"
version: "1.7.2"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -301,26 +301,26 @@ packages:
dependency: "direct main"
description:
name: dynamic_color
sha256: "74dff1435a695887ca64899b8990004f8d1232b0e84bfc4faa1fdda7c6f57cc1"
sha256: eae98052fa6e2826bdac3dd2e921c6ce2903be15c6b7f8b6d8a5d49b5086298d
url: "https://pub.dev"
source: hosted
version: "1.6.5"
version: "1.7.0"
extended_image:
dependency: "direct main"
description:
name: extended_image
sha256: e77d18f956649ba6e5ecebd0cb68542120886336a75ee673788145bd4c3f0767
sha256: d7f091d068fcac7246c4b22a84b8dac59a62e04d29a5c172710c696e67a22f94
url: "https://pub.dev"
source: hosted
version: "8.0.2"
version: "8.2.0"
extended_image_library:
dependency: transitive
description:
name: extended_image_library
sha256: af3ff1c09c23ca7663f94272313d63499a6bd19121e99378e375e0cf2ac7a3e4
sha256: a7cc0270299589ba12b21152abd8ac7287ac8e1997c7ce1a26c337bac4429208
url: "https://pub.dev"
source: hosted
version: "3.5.2"
version: "4.0.2"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -370,10 +370,10 @@ packages:
dependency: "direct main"
description:
name: flutter_cache_manager
sha256: "32cd900555219333326a2d0653aaaf8671264c29befa65bbd9856d204a4c9fb3"
sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba"
url: "https://pub.dev"
source: hosted
version: "3.3.0"
version: "3.3.1"
flutter_displaymode:
dependency: "direct main"
description:
Expand Down Expand Up @@ -569,18 +569,18 @@ packages:
dependency: transitive
description:
name: http
sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2"
sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba
url: "https://pub.dev"
source: hosted
version: "0.13.6"
version: "1.2.0"
http_client_helper:
dependency: transitive
description:
name: http_client_helper
sha256: "14c6e756644339f561321dab021215475ba4779aa962466f59ccb3ecf66b36c3"
sha256: "8a9127650734da86b5c73760de2b404494c968a3fd55602045ffec789dac3cb1"
url: "https://pub.dev"
source: hosted
version: "2.0.4"
version: "3.0.0"
http_multi_server:
dependency: transitive
description:
Expand Down Expand Up @@ -609,10 +609,10 @@ packages:
dependency: "direct main"
description:
name: intl
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
url: "https://pub.dev"
source: hosted
version: "0.18.0"
version: "0.18.1"
io:
dependency: transitive
description:
Expand Down Expand Up @@ -653,6 +653,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.7.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
url: "https://pub.dev"
source: hosted
version: "2.0.1"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
url: "https://pub.dev"
source: hosted
version: "2.0.1"
lints:
dependency: transitive
description:
Expand All @@ -673,18 +697,18 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.15"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.8.0"
media_scanner:
dependency: "direct main"
description:
Expand All @@ -697,10 +721,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.11.0"
mime:
dependency: "direct main"
description:
Expand Down Expand Up @@ -745,10 +769,10 @@ packages:
dependency: "direct main"
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
path_provider:
dependency: "direct main"
description:
Expand Down Expand Up @@ -797,14 +821,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.7"
pedantic:
dependency: transitive
description:
name: pedantic
sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
permission_handler:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1078,10 +1094,10 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
sqflite:
dependency: "direct main"
description:
Expand All @@ -1102,10 +1118,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
state_notifier:
dependency: transitive
description:
Expand All @@ -1118,10 +1134,10 @@ packages:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
stream_transform:
dependency: transitive
description:
Expand Down Expand Up @@ -1158,26 +1174,26 @@ packages:
dependency: transitive
description:
name: test
sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4"
sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f
url: "https://pub.dev"
source: hosted
version: "1.24.1"
version: "1.24.9"
test_api:
dependency: transitive
description:
name: test_api
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev"
source: hosted
version: "0.5.1"
version: "0.6.1"
test_core:
dependency: transitive
description:
name: test_core
sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93"
sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a
url: "https://pub.dev"
source: hosted
version: "0.5.1"
version: "0.5.9"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -1342,10 +1358,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: f3743ca475e0c9ef71df4ba15eb2d7684eecd5c8ba20a462462e4e8b561b2e11
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
url: "https://pub.dev"
source: hosted
version: "11.6.0"
version: "13.0.0"
wakelock:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1394,6 +1410,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web:
dependency: transitive
description:
name: web
sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05"
url: "https://pub.dev"
source: hosted
version: "0.4.2"
web_socket_channel:
dependency: transitive
description:
Expand Down Expand Up @@ -1451,5 +1475,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.0.3 <4.0.0"
flutter: ">=3.10.4"
dart: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ dependencies:
dio_smart_retry: ^5.0.0
dio: ^5.0.0
dynamic_color: ^1.4.0
extended_image: ^8.0.1
file_picker: ^5.2.3
flutter_cache_manager: ^3.0.0-nullsafety.1
flutter_displaymode: ^0.6.0
flutter_downloader: ^1.9.0
flutter_downloader: ^1.10.4
flutter_hooks: ^0.18.5+1
flutter_speed_dial: ^7.0.0
flutter_staggered_grid_view: ^0.6.1
Expand Down Expand Up @@ -81,6 +80,7 @@ dependencies:
wakelock: ^0.6.2
xml2json: ^6.0.0
yaml: ^3.1.0
extended_image: ^8.2.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 7c80b72

Please sign in to comment.