Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Batch url add #352

Open
Invictaz opened this issue Jan 23, 2024 · 5 comments
Open

[FEATURE REQUEST] Batch url add #352

Invictaz opened this issue Jan 23, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Invictaz
Copy link

If you add 5 episodes like

https://1fichier.com/?blablabla.S01E01.mkv

https://1fichier.com/?blablabla.S01E02.mkv

https://1fichier.com/?blablabla.S01E03.mkv

https://1fichier.com/?blablabla.S01E04.mkv

https://1fichier.com/?blablabla.S01E05.mkv

It adds either only the first or the last episode.

The only way to add these is via the real-debrid website.

From other apps I remember that multiple items would be separated by ; or , or others. This is not possible because the links are retrieved from a pastefile that shows them line by line.

@Invictaz Invictaz added the enhancement New feature or request label Jan 23, 2024
@LivingWithHippos
Copy link
Owner

I think you can add them if they are separated by a newline but I need to double check

Link 1
Link 2
Link 3

@Invictaz
Copy link
Author

I tried but that didn't work (from Samsung notes)

Screenshot_20240123_211825_Samsung Notes

@LivingWithHippos
Copy link
Owner

Confirmed, code for multiple links is already there, the problem is probably that the first line is recognized as a web link and then the whole list is sent as a single link.

@LivingWithHippos LivingWithHippos added bug Something isn't working and removed enhancement New feature or request labels Feb 25, 2024
@Invictaz
Copy link
Author

Interesting. Is it fixable?

@LivingWithHippos
Copy link
Owner

Interesting. Is it fixable?

yes of course the code just need to be moved and fixed a little

link.isWebUrl() || link.isSimpleWebUrl() -> {
viewModel.postMessage(getString(R.string.loading_host_link))
enableButtons(binding, false)
var password: String? = binding.tePassword.text.toString()
// we don't pass the password if it is blank.
// N.B. it won't work if your password is made up of spaces but then again
// you deserve
// it
if (password.isNullOrBlank()) password = null
val remote: Int? =
if (binding.switchRemote.isChecked) REMOTE_TRAFFIC_ON else null
viewModel.fetchUnrestrictedLink(link, password, remote)
}
link.isBlank() -> {
viewModel.postMessage(getString(R.string.please_insert_url))
}
link.isContainerWebLink() -> {
viewModel.unrestrictContainer(link)
}
link.split("\n").firstOrNull()?.trim()?.isWebUrl() == true -> {
// todo: support list of magnets/torrents
val splitLinks: List<String> =
link.split("\n").map { it.trim() }.filter { it.length > 10 }
viewModel.postMessage(getString(R.string.loading))
enableButtons(binding, false)
// new folder list, alert the list fragment that it needs updating
activityViewModel.setListState(ListState.UpdateDownload)
val action =
NewDownloadFragmentDirections.actionNewDownloadDestToFolderListFragment(
folder = null,
torrent = null,
linkList = splitLinks.toTypedArray()
)
findNavController().navigate(action)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants